What alt text is for
The alternative text (an image's alt attribute) describes an image in words and serves three jobs at once:
- For blind and visually impaired people: the screen reader reads it out — it's their only access to the image content.
- When the image fails to load: the alt text appears in its place.
- For search engines: they can't see images and understand the content via alt text — the basis of image search.
An image without alt text is simply a hole in all these cases. Good alt text serves accessibility and discoverability in one move.
The basic rule: content and purpose, briefly
Good alt text answers: what does the image show, and why is it here? Usually one sentence is enough. Examples:
| Bad | Good |
|---|---|
| “Image” | “A child planting a seedling in a flower pot.” |
| “DSC_4821.jpg” | “A red garden bench in front of a white brick wall.” |
| “Photo of our team at the meeting …” | “Four people discussing a building plan at a table.” |
The most common mistakes
- “Image of …” / “Photo of …”:the screen reader already announces “image”. Write the content directly, or the user hears “image, image of …”.
- The file name as alt text:
IMG_4821.jpghelps no one. Descriptive file names are good, but they don't replace alt text. - Keyword stuffing:“compress image tool free online shrink image JPG PNG” is bad for humans and search engines alike — modern engines detect it and devalue it.
- Too much detail:alt text is not an image inventory. “What matters for the purpose?” is the guiding question, not “what's all in the image?”.
Context decides
The same image needs different alt text depending on use. A photo of a running shoe:
- In an online shop: “Blue running shoe, model XY, side view.” (the buying information)
- In an article on injury prevention: “Running shoe with a cushioned sole.” (the relevant aspect)
So there isn't one correct alt text — there's the right one for this purpose in this place.
When alt text stays empty
Important and often overlooked: purely decorative images (dividers, background ornaments, an icon next to a labeled link) should get an empty alt text (alt="") so the screen reader skips them. Alt text that adds nothing is noise. When to leave it empty and when to describe is a topic in itself, covered in Decorative images and empty alt text.
Complex images need more
A chart, an infographic, or a map can't be captured in one sentence. Here a short alt summary goes in the image, and the full description into the surrounding text or a linked long description. Keep the alt line honest about what the graphic conveys, and let the body carry the detail.
In short
- Content + purpose, one sentence. Skip “image of”.
- No file names, no keyword stuffing.
- Context changes the right answer.
- Decorative = empty alt, complex = describe elsewhere.