Image SEO and speed: file names, alt text and sizes

How to name, describe and size images so people, screen readers and search engines can use them without slowing the page: file names, alt text and checks.

BeginnerHow-to7 min readUpdated October 30, 2026

In this guide
  1. What image SEO covers
  2. File names
  3. Alt text
    1. Writing it well
    2. How common it is
  4. Real images, not backgrounds
  5. The speed side
  6. Captions and nearby words
  7. How to check
  8. Mistakes to avoid
  9. Check your own page
  10. Sources

What image SEO covers

The 2025 Web Almanac calls the alt attribute central to accessibility and says it also supports image indexing in search. Most of what helps an image in search also helps a visitor, and the same is true for speed. So treat the work as three jobs:

  1. Be understood. A name, alt text and nearby words say what the image is for.
  2. Be found. A real img element in the page source gives crawlers and assistive tools something to read.
  3. Be light. The right size, format and loading keep the image from slowing the page. The other guides in this topic cover that part in depth.

This guide does not claim that any one of these changes moves a ranking. It sticks to what the documentation says the attributes are for.

File names

web.dev's accessibility course says to name images as consistently and accurately as you can, because image names are a fallback when the alt text is missing or ignored. MDN agrees on the risk: when an image has no alt attribute, some screen readers announce the file name, which confuses people if the name tells them nothing.

web.dev also advises dashes between words rather than underscores, and no symbols or other non-letter characters. In practice:

Instead ofUse
IMG_4821.jpgblue-ceramic-teapot.jpg
Final_FINAL (2).pngteam-front-desk.png
hero.jpg on every pageplumber-fixing-sink.jpg

Three habits around names cost nothing:

Alt text

MDN says the alt attribute defines text that can replace the image. Browsers do not always display images: people use non-visual browsers, switch images off to save bandwidth, or meet a file that is broken or in an unsupported format. In those cases the alt text stands in.

web.dev's accessibility course sorts images by purpose, and each kind needs something different:

KindWhat it isWhat to write
DecorativeAdds style, not informationAn empty alt="", so assistive tools skip it
InformativeA photo, a drawing, an essential iconA short description of what it shows
FunctionalA logo that links home, a search icon on a buttonThe action, not the picture: "Search", not "magnifying glass"
ComplexA chart, a map, an infographicA short alt, plus a longer description nearby, linked or tied on with aria-describedby or a figure and figcaption

MDN explains the empty case. alt="" tells browsers the image is not a key part of the content, so non-visual browsers may leave it out. A missing alt is different: some screen readers read out the file name instead. Always write the attribute, even when it is empty.

Writing it well

For an inline SVG icon, alt does not exist. Give an informative one role="img" and a title. See SVG for speed.

How common it is

In the 2025 Web Almanac, the median mobile page had alt attributes on 60% of its images, up from 58% in 2024. Blank values were on 15% of images on the median mobile page, up from 14%. The Almanac points out that a blank value is better than none but is no help to a screen reader or a search engine when the image is not decorative.

Real images, not backgrounds

An img element carries an alt. A CSS background image does not. web.dev's course notes that a screen reader will not detect an image added as a CSS background, so use backgrounds only for decoration. A product photo, a team picture or a diagram belongs in an img.

Keep the image address in the HTML too. Some lazy loaders put the real address in a data-src attribute and fill in src after a script runs, so the page source shows no image until then. The native loading="lazy" attribute keeps the src in the markup. See how to fix a slow LCP and lazy loading.

If crawlers are blocked from the folder that holds your images, they cannot fetch the files. See robots.txt and noindex.

The speed side

The same images have to be light. Four things matter most, and each has its own guide:

Lighthouse 13.5 has two Best Practices checks on images as well. One flags images shown in a different shape from their real one, and one flags images whose own size is too small for the display size and pixel ratio.

Captions and nearby words

MDN says that an image which needs a caption should be wrapped in figure with a figcaption. A caption is visible text, so everyone gets it, and it ties the words to the picture. Put the picture near the text that explains it. web.dev's tip for deciding whether an image is decorative is a good test for this too: hide the images on your page and ask whether you still understand the content that remains. If not, the words should say more.

How to check

  1. Run Lighthouse or PageSpeed Insights and open the accessibility results. In Lighthouse 13.5 the image-alt audit counts in two categories: accessibility, where its weight of 10 is the top tier, and SEO, where its weight is 1. On a test page, I ran Lighthouse 13.5. The image-alt audit failed for the one image that had no alt attribute, and it passed the image with alt="" and the one with a description. Its svg-img-alt audit failed for an svg with role="img" and no title, and passed one with a title.
  2. Read the performance insights for oversized and old-format files. See how to read a speed report.
  3. Scan the page source for <img tags with no alt. In the Network panel, the Img filter lists the file names. See the Network panel.
  4. Hide the images and read the page. Does it still make sense?
  5. Listen once with a screen reader on your most important page. Ten minutes shows more than any audit.

Mistakes to avoid

Check your own page

Run the free audit and read the accessibility results for images. Then open your home page, hide the images, and read what is left. Fix the alt text on the images that matter, and rename the ones that still carry camera names.

Sources

Start here

Free website audit

Live Google data for any public page: mobile and desktop.

Mobile + desktop · Lighthouse lab test · Real-user Chrome data when Google has it

Rather have this done for you? Speed optimization · Book a call

Related guides

All guides →