Accessibility
Alt text
Alt text is the written alternative for an image, read aloud by screen readers and shown by browsers when the image cannot be displayed.
WCAG 1.1.1 requires a text alternative for every image that carries meaning. A decorative image gets an empty alt attribute, so assistive technology skips it.
At a glance
| Where it lives | The alt attribute on an <img> element |
| Required by | WCAG 1.1.1 Non-text Content (Level A) |
| Informative image | A brief description of what the image shows, in the context of the page |
| Functional image | What the control does ("Search"), not what the icon looks like |
| Decorative image | An empty attribute, alt="", so screen readers skip it |
| How often it is missing | On 53.1% of the top one million home pages (WebAIM Million, 2026) |
| Detected by | OverlayQA Accessibility Audit |
Why it matters
A screen reader user gets nothing from an image without alt text, and when the attribute is missing altogether some screen readers announce the file name instead (MDN). Browsers also show the alt text when the image fails to load, so it protects every visitor on a slow or blocked connection.
It is one of the most common accessibility failures on the web. WebAIM's 2026 scan of the top one million home pages found images with missing alt text on 53.1% of them: 16.2% of all images had no alt, 45% of those were links, and a further 10.8% of images with alt had text that was questionable or repeated nearby content (WebAIM Million, 2026).
How do you write good alt text?
The W3C's alt decision tree turns the choice into a few questions. Ask them in order.
- Does the image contain text? Repeat the text in the alt, unless the same words already sit next to the image. Then the alt is empty.
- Is the image a link or a button? Describe the action or the destination, not the picture: "Search", not "magnifying glass".
- Does the image add information? Write a brief description of what matters in this context. A product photo needs the color and the angle it shows; a mood photo in a header needs nothing.
- Is it decorative? Give it an empty alt,
alt="", so screen readers skip it. Leaving the attribute off is not the same thing. - Is it complex, like a chart? Keep the alt short and put the full information in the page text or a linked table.
Examples
| Image | Alt text | Why |
|---|---|---|
| Product photo on a listing | alt="Blue laptop backpack, front view" | What a sighted shopper sees |
| Search icon inside the search button | alt="Search" | The action, not the drawing |
| Logo that links to the home page | alt="OverlayQA home" | The destination |
| Flourish between two sections | alt="" | Decorative, so screen readers skip it |
| Bar chart of monthly sign-ups | alt="Monthly sign-ups, January to June 2026", with the figures in the text below | A chart needs its data, not a picture of the bars |
Common mistakes
- Leaving the attribute off. No alt at all fails WCAG 1.1.1 (failure F65), and some screen readers read the file name in its place. A decorative image needs
alt="", not nothing. - Filler values.
alt="image"oralt="spacer"on a decorative image is failure F39; on a meaningful image it says nothing useful. - Describing the icon instead of the action. A trash-can button is "Delete", not "trash can".
- Repeating the caption. If the words already sit next to the image, the alt adds noise. WebAIM found questionable or repetitive alt on 10.8% of the images that had any.
- Keyword stuffing. Alt text is for people. A list of search terms is read aloud, word by word, to someone trying to use the page.
Frequently asked questions
Is alt text required on every image?
Every image that carries meaning needs a text alternative under WCAG 1.1.1. A purely decorative image needs an empty alt attribute instead, so assistive technology ignores it. Leaving the attribute off entirely is wrong in both cases.
How long should alt text be?
WCAG sets no length. The W3C tutorial asks for a brief description of what the image conveys in context. If the image needs more, as a chart does, keep the alt short and put the detail in the page text.
What goes in the alt text of a linked image or an icon button?
The action or the destination: "Search", "Next page", "OverlayQA home". The W3C decision tree treats functional images separately from informative ones for exactly that reason.
What happens if the alt attribute is missing?
The page fails WCAG 1.1.1, and MDN notes that some screen readers announce the image file name instead, which is confusing when the file name says nothing about the picture.
Sources: WCAG 2.2, 1.1.1 Non-text Content, W3C WAI, An alt Decision Tree, WebAIM Million 2026, MDN, the img element.
Last updated October 22, 2026