Write alt text for the information or function an image provides in its current context. Briefly describe an informative image, identify the action or destination of an image-only control, and use an empty alt attribute for a genuinely decorative image. Put complex information in accessible page text as well.
On this page
Start with what the image does on this page
Alt text is a text alternative attached to an image. For an ordinary HTML image, it is supplied through the alt attribute of the <img> element. Its job is to carry the useful information or function that someone would otherwise get from seeing it. The right wording therefore depends on where the image appears and what the reader is trying to do.
Before writing, ask three questions:
- Does this image add information the surrounding text does not provide?
- Is it the only content identifying a link or button?
- Would a short description miss important details that need a longer explanation?
The W3C WAI decision tree uses context, function and nearby text to guide the choice. Start with those facts rather than copying the same description everywhere a file appears.
| Image's role | Useful text alternative | Common mistake |
|---|---|---|
| Informative picture | Convey the relevant information briefly | List every visible detail regardless of purpose |
| Decoration or fully redundant illustration | Use an empty alt attribute when appropriate | Omit the attribute or add repetitive narration |
| Image-only link or button | Identify the destination or action | Describe its appearance while leaving its purpose unclear |
| Complex diagram or chart | Give a short identification and an accessible longer explanation | Put all the essential information only in the image |
One mug image, three different jobs
The image below is an illustration of an imaginary product. The following page placements are hypothetical; they are not screenshots of a shop or claims about a real item.

The illustration supplies a concrete object for comparing the examples. It does not establish capacity, materials, manufacturing method or product availability.
On a product page: describe the relevant visible information
Imagine a page where a customer is choosing between differently colored mugs. The coral color and rounded handle help distinguish the pictured option. A useful starting point is:
<img src="coral-mug.webp" alt="Coral mug with a rounded handle">
“Product image” contributes little. “Best handmade 12-ounce dishwasher-safe ceramic mug” adds facts that this illustration cannot verify. If a real product has verified specifications, put them in normal product copy; do not invent them from its appearance.
WAI's informative-image guidance emphasizes conveying the image's meaning in context. In a handle-design article, the handle's shape may be the central detail. In a color selector, the color may matter more. The author must decide what the picture contributes to that particular task.
As an image-only link: explain where it goes
Now imagine the mug is the only content inside a link to the shop's mug collection. A destination-based alternative is more useful:
<a href="/shop/mugs">
<img src="coral-mug.webp" alt="Browse mugs">
</a>
These are illustrative paths and markup, not links to a store on this site. A description of the mug's handle would not explain what activating the link does. WAI's functional-image guidance addresses that difference.
If the same link already contains visible text such as “Browse mugs,” the image may be redundant. Evaluate the complete link's accessible name instead of automatically making its image repeat the label. Preserve any additional information the image actually contributes. Text in a separate caption is not necessarily part of the link's name; check the actual link rather than assuming nearby words label it.
This is also a navigation decision. The internal-linking guide explains why a clear destination matters to someone following a link.
As decoration: an empty alternative can be intentional
Finally, imagine a repeated mug illustration used only to add atmosphere beside text that already supplies every relevant detail. If removing it would lose no information or function, it can be decorative:
<img src="coral-mug.webp" alt="">
An empty value is different from leaving out the attribute. WAI's decorative-image guidance explains that a missing attribute can cause some screen readers to announce a filename. An empty alternative avoids extra narration when the image has no useful contribution.
Do not use this shortcut for an image-only button, an essential product distinction or instructions that exist only in a picture. “Decorative” describes the image's role in its current context, not whether it looks attractive.
Give complex information room outside the alt attribute
A route diagram, comparison chart or assembly illustration may contain more information than a brief alternative can carry. WAI's complex-image guidance calls for both short identification and a fuller text equivalent of the important information.
For example, a fictional delivery-area map could have a short alternative identifying the map and directing readers to a nearby service-area list. That list would need to state the actual covered locations and any important exclusions. A vague phrase such as “delivery map” would not replace those facts.
Write the useful explanation as accessible page text. A real chart may need its values and relationships in a table or longer description. The best format depends on what the image is communicating; do not manufacture a chart merely to decorate the page.
Keep SEO wording tied to the visible image
Google's image guidance says it uses alt text alongside page content and image understanding to interpret the subject. It recommends useful contextual wording and warns against keyword stuffing.
For the mug example, a string of sales phrases and color synonyms would not improve the text alternative. A concise accurate description serves the reader and gives the image relevant context. It cannot promise a position in image search, traffic or an AI citation.
Keep the image near the copy it supports, and make that surrounding explanation useful in its own right. A filename, visible caption and alt attribute have related purposes but are not interchangeable fields. A caption can explain a point to everyone reading the page; the alternative needs to work for the image's information or function in context.
Review the published result, including links
Treat generated alt text as a draft. Compare every proposed detail with the actual image and the page's job. This uses the same evidence-first approach as the answer-first writing walkthrough: verify the facts before polishing the wording.
A small review worksheet is enough:
- Record the image's URL and the page where it is used.
- State whether it informs, decorates, links or carries complex information.
- Note what the nearby text already explains.
- Write the shortest useful alternative for this context.
- Check the published image's actual alt value and, for a link or button, its accessible name. CMS field names vary, so inspect the output rather than assuming an image-title or description field supplies alt text.
- Use keyboard navigation and assistive-technology checks appropriate to the page; a saved CMS field alone does not prove a useful experience.
Read the result as part of the surrounding page. If the alternative invents facts, repeats a label unnecessarily or leaves a link's purpose unclear, revise it. The goal is a usable explanation of this image's job, supported by what the reader can actually learn from it.
Sources & further reading
Primary references checked Oct 26, 2026. Platform guidance can change.
AI-assisted research and writing. Learn about our editorial standards.
Suggest a correction ↗




