Image alt text: when to describe an image and when to leave it empty
Updated:
An image’s alternative text should convey information or a function that the reader would otherwise miss. Some images need no written description. Decoration can have empty alt text, a product photograph can describe an important detail, and an icon in a button must help explain its action.
The right text depends on how the image is used on that particular page. The same photograph may be an illustration in one article and explain an essential step in a guide.
Establish what the image does on the page
Cover the image and read the surrounding text. What would the user miss? Do they need to know the product’s appearance, a measurement result or a link destination? If no important information or function disappears, a description may be unnecessary.
| Image role | What the reader needs | Example decision |
|---|---|---|
| Information | The meaning needed in this context | A fastening detail in a product photograph |
| Control or link | An action or destination | Opening the basket, rather than describing a drawing of one |
| Chart or diagram | A short identification and accessible detail | A description of the result and a data table |
| Decoration or repeated text | No additional reading | Empty alt text for an illustrative image |
The W3C WAI decision tree helps distinguish these cases. Avoid applying one answer to every image in a gallery or template. Assess whether accessible text already provides the information and whether the image also serves another purpose.
Missing alt text and empty alt text are different
For a decorative HTML image, use an explicit alt="" attribute. This records a decision that the image adds no content that needs reading. Omitting the attribute does not express that decision, and some screen readers may announce the filename. The decorative images guidance explains the distinction.
Do not automatically give every banner empty alt text. A banner providing the only notice of changed opening hours is informative, even if it looks decorative. Include important information as ordinary text too, so it does not depend on the image loading.
Alt text is not a universal solution for every visual element either. A CSS background image does not have an alt attribute like an img element. If it presents important content, provide that through accessible text or change how the image is included.
Describe the actual action of an icon
A basket icon might open the basket or add a product. Choose its name according to its behaviour: “Basket” for a link to its contents, “Add to basket” for the corresponding button. Similarly, distinguish opening search from submitting an entered query.
When an image is the only content of a control and its alt text provides the accessible name, that text must identify the destination or action. If text in the same link or button already provides the name, a redundant icon can have empty alt text. W3C distinguishes these cases in its functional images guidance.
Checking the image’s HTML alone is insufficient. Verify the resulting name of the whole control. Other naming in the component can affect it too. Do not try to fix an incorrect name by adding contradictory labels. Change the source that creates the name and check the result again.
A product photograph should explain a useful difference
Consider a model shop selling backpacks. For a close-up of a fastening, “Side buckle detail on the black backpack” is useful. “Product image” does not distinguish what the photograph shows. Include colour or material only when relevant to this image and verified.
A repeated thumbnail beside an accessible product name may not need to repeat that whole name. This also depends on whether the thumbnail is a separate link. In a gallery, distinguish the front view, internal layout or detail if those are the details the photographs provide.
The W3C informative images guidance emphasises meaning in context. Do not describe every visible object simply because AI can recognise it. With a generated draft, check the model, colour, packaging text and claims about properties in particular. A photograph alone may not reliably establish material or certification.
A chart also needs accessible data
“Results chart” is usually insufficient. Short alt text should identify what the chart represents and, where needed, direct the reader to a fuller description. Make values, units, axis meanings and important relationships available in text or a table beside the chart. See the complex images guidance for detail.
Preserve what the chart actually shows. Do not say performance improved if it compares another quantity or you lack evidence for that conclusion. The reader should receive the information needed for their own assessment as well as the editorial interpretation.
Use a similar approach for an illustrated guide. Write essential steps as text. A screenshot’s alt text can then add orientation or a difference the text does not explain. A whole procedure hidden in one long attribute is difficult to use and maintain.
How to fix an existing site through a CMS
Start with critical areas: navigation, checkout, forms and content where images carry important information. Then check repeated components and galleries. For each finding, record the URL, image, its role and the proposed correction.
- Check where the template gets alt text and whether it can be changed for a particular use.
- Distinguish a missing value from an intentionally empty one. The CMS must not substitute one for the other without checking.
- Verify whether a media library change also affects pages where the image serves a different purpose.
- Prepare text in the page’s language. Preserve product names and technical identifiers according to the source material.
- After saving, inspect the rendered page, not just the CMS form field.
If the editor cannot set empty alt text, or the template substitutes a filename, a developer also needs to fix the issue. Filling in media library descriptions alone may not resolve it.
How to check that the change helped
An automated check can find a missing attribute or a problem with a control’s name. Assess description quality manually too. “Photograph” may be a populated value while conveying none of the information needed. Intentionally empty alt text may be correct or may hide important content.
When checking with a screen reader, assess whether the user understands links and buttons, receives important image content and avoids repeated names or filenames. Check functional elements with a keyboard too. Correct alt text alone will not fix a button that cannot be operated.
The correction is complete when the text matches the image’s purpose, necessary information remains accessible and the template preserves that choice through later content edits. Reassess the alternative when replacing a photograph or changing a link’s function.