Image alt text, file names and formats: image SEO for blog posts
By Thomas Lovas Lokoy · Published 16 October 2026 · 7 min read

Image alt text does two jobs at once. It is the text a screen reader speaks in place of the picture, and it is, in Google's words, "the most important attribute when it comes to providing more metadata for an image". Those two jobs pull in the same direction far more often than SEO advice suggests: alt text written for a person who cannot see the image is almost always the alt text a search engine can use best. This guide covers how to write it, when to leave it empty, and the two quieter decisions around it: what to call the file and which format to save it in.
Why image alt text matters for search and for readers
Google's image SEO documentation says it uses alt text "along with computer vision algorithms and the contents of the page to understand the subject matter of the image". It also notes that when an image is used as a link, its alt text works as the link's anchor text.
The W3C's Web Accessibility Initiative (WAI) starts from the reader instead: images "must have text alternatives that describe the information or function represented by them". Its images tutorial lists who benefits, from people using screen readers or speech input to mobile users who have switched images off, and it names search engine optimisation on the same list: images become indexable.
So there is no separate "SEO alt text". There is useful alt text and there is alt text that wastes everyone's time.
How to write alt text: five rules
- Describe what the image is for, not just what it shows. The WAI's informative images guidance says the text alternative "typically isn't a literal description of the image". Its example: a photo of a dog wearing a bell, next to a paragraph about guide dogs, gets the alt text "Dog with a bell attached to its collar." The bell is the point, so the bell is in the description.
- Be specific. Google's own ladder of examples for a puppy photo runs from no alt text (bad), through a keyword list (bad), to "puppy" (better) and "Dalmatian puppy playing fetch" (best). The best version names the breed and the action, which is what a person searching would type and what a listener would want to know.
- Use the page's keyword only if it describes the image. Google asks for "useful, information-rich content that uses keywords appropriately and is in context of the content of the page", and warns that filling alt attributes with keywords "results in a negative user experience and may cause your site to be seen as spam".
- Do not repeat the caption or the paragraph next to the image. If the surrounding text already says everything the image shows, the WAI treats the image as decorative (see below). Repeating it makes a screen reader say the same thing twice.
- Put the image near the text it illustrates. Google says it extracts information about an image from the page, "including captions and image titles", and asks that images be placed near relevant text and on pages relevant to their subject.
For an image that contains text, such as a quote card or a slide, the alt text should contain the same words, unless they also appear as real text nearby. For a chart or diagram, a short alt text is not enough: the WAI decision tree says to include the information contained in the image elsewhere on the page. In a blog post that usually means one sentence stating what the chart shows, or a small table of the figures.
When to leave alt text empty
Not every image should be described. The WAI defines decorative images as ones that "don't add information to the content of a page": borders and spacers, illustrations that only add atmosphere, and images already described by the surrounding text. For these, the correct value is a null alt attribute, written alt="" with nothing between the quotes.
Empty is not the same as missing. The WAI is explicit that leaving the attribute out is not an option, because "some screen readers will announce the file name of the image instead". A missing alt on a stock header image called hero-final-v3-cropped.jpg may be read aloud as exactly that.
The WAI's alt decision tree reduces the choice to a short sequence of questions:
- Does the image contain text? If that text is also on the page nearby, or is only there for visual effect, use an empty alt. If not, put the text in the alt.
- Is the image a link or a button that would be hard to understand without it? Describe where the link goes or what the button does, not what the icon looks like.
- Does the image add meaning? For a simple photo or graphic, give a brief description of that meaning. For a graph, put the information elsewhere on the page.
- Is it purely decorative? Use an empty alt.
Whether an image is decorative is, as the WAI puts it, "a judgment that only the author can make". The same stock photo of a family can be decoration on one page and the whole message on another. The WAI's example for the second case gives a family photo the alt text "We're family-friendly", because that is the impression the image is there to convey.
File names: light clues, but free ones
Google is careful about how much weight file names carry: the filename "can give Google very light clues about the subject matter of the image". Its advice is to use names that are "short, but descriptive", giving my-new-black-kitten.jpg as better than IMG00023.JPG, and to avoid generic names like image1.jpg, pic.gif or 1.jpg.
Two further points from the same page are easy to miss:
- Translate file names when you translate the page. Google says that if you localise images you should translate the filenames too, following URL encoding guidelines for non-Latin or special characters.
- Use one URL per image. If the same image appears on many pages, reference it with the same URL each time so Google can cache it rather than request it repeatedly.
A practical routine: rename the file before upload, using lower-case, hyphenated words that describe the subject. The file name is not the place for the article's keyword unless the image actually shows it.
Formats: what Google indexes and what to choose
Google Search supports images in BMP, GIF, JPEG, PNG, WebP, SVG and AVIF format, and advises that the file extension should match the file type. It indexes images placed with a standard HTML image element, including one inside a picture element, and it does not index images set as CSS backgrounds. That last point matters for themes that place the post's lead image as a background: it is invisible to image search.
For choosing between formats, MDN's image format guide gives the clearest rules:
- Photographs: prefer WebP or AVIF, which "generally provide better compression than PNG, JPEG, and GIF". Photographs tolerate lossy compression, so JPEG is a reasonable fallback.
- Screenshots, diagrams, logos and line art: prefer lossless encoding, because blurring and coloured fringes around text and sharp edges are very visible. PNG is the lossless fallback, and the fallback for anything needing transparency.
- Charts, diagrams and icons that must stay sharp at any size: use SVG.
MDN also suggests considering JPEG XL for large, high-resolution images. It is not on Google's list of supported formats for search, so if image search traffic matters to you, serve a supported format as the fallback.
Whatever the format, size matters. Google notes that images "are often the largest contributor to overall page size", and that sharp images are more appealing in the result thumbnail and can increase the likelihood of getting traffic. If you use responsive images with srcset, Google recommends always specifying a fallback URL in the src attribute, because some browsers and crawlers do not understand srcset.
Choosing the image Google shows for the post
Which image appears beside your page in results or in Discover is chosen automatically, but Google says you can influence it by naming a preferred image: with the schema.org primaryImageOfPage property, with an image attached to the page's main entity in structured data, or with the og:image meta tag. Its advice for that image: relevant and representative of the page, not a generic logo, not an image with text, no extreme aspect ratio, and high resolution if possible. The guide to Article structured data for blog posts shows where the image property goes.
A checklist before you publish
- Every informative image has alt text that says what it is there for, in a sentence a listener would find useful.
- Every decorative image has alt="", and no image has the attribute missing.
- Charts have their key figures in the text, not only in the image.
- File names are short, descriptive and hyphenated.
- Photographs are WebP or AVIF with a sensible fallback; screenshots and diagrams are lossless or SVG.
If a tool wrote your alt text or captions, review them like any other copy. Google's guidance on generative AI content says the manual check should extend to metadata, naming "alternate texts for images" alongside titles, meta descriptions and structured data. The routine in how to fact-check an AI-written article includes that step, and AI-generated content and Google Search explains the wider policy.
Sources
- Google image SEO best practices, Google Search Central
- Images Tutorial, W3C Web Accessibility Initiative
- Informative Images, W3C Web Accessibility Initiative
- Decorative Images, W3C Web Accessibility Initiative
- An alt Decision Tree, W3C Web Accessibility Initiative
- Image file type and format guide, MDN
- Google Search's guidance on using generative AI content on your website