Google Image SEO: Filenames and Alt Text
How to write image filenames, alt text, and surrounding content that help search engines and users understand your images.
Image SEO is not only about smaller files. Search engines use filenames, alt text, captions, surrounding text, and page context to understand what an image represents.
Use short, descriptive filenames. A filename like `webp-compression-quality-comparison.webp` is more useful than `image1.webp`. Lowercase English words with hyphens are usually easy to manage across systems.
Alt text should describe the image's meaning or function. Avoid stuffing keywords. If the image is a product photo, describe the product; if it is a UI screenshot, describe what the screenshot shows.
Surrounding content should support the image. Adding unrelated images and forcing keywords into alt text does not create a useful page. The best image SEO comes from helpful images placed in the right context.
- Write descriptive filenames with hyphens.
- Use alt text as an image description, not a keyword list.
- Place images near relevant text.
- Avoid over-describing decorative images.
- Optimize file size and accessibility together.
Alt text should describe what the image contains rather than list keywords. The alt text on both images below can be inspected in this page's source.


File size dropped 83.4% in this comparison. When the same photo plays a different role in the text, its alt text should change too. The images above are web-sized previews; the sizes shown are those of the full original files.
Write for people before search engines
A descriptive filename helps editors, developers, and search engines understand the image. Use short lowercase words and hyphens where practical, and make the file name describe the image rather than a keyword target alone.
Alt text should replace the image meaning
Good alt text explains the image's role in the page. A product image may need color and shape, while a UI screenshot may need the action or screen state. Repeating keywords is weaker than describing what the image actually communicates.
Image SEO combines files and context
Observed result
The quality 80 WebP photo output was 92.6% smaller, but search engines also use filenames, alt text, surrounding paragraphs, and page context to understand images.
Common failure case
Keyword-stuffed alt text and unrelated images weaken usefulness. Smaller files do not compensate for unclear image meaning.
Decision rule for this page
After compression, use descriptive filenames and write alt text that explains the image's information or function in the page.
The source and output files are published in the compression benchmark. Use descriptive filenames and alt text that match the page context. Google Image SEO guidance
What happens if I leave alt text empty?
An empty alt attribute makes it harder for search engines to understand the image and prevents screen readers from conveying its content to visually impaired users. Use an empty alt="" only for purely decorative images. Any image that supports the article's meaning needs a descriptive alt text.
Does repeating keywords in alt text improve SEO?
No, and it can be flagged as keyword stuffing. Google prefers alt text that reads like an accurate description of the image. For a before-and-after compression example, something like 'WebP quality 80 compression result compared with the original JPG' is more useful than repeating keyword phrases.