How to Write Alt Text That Passes WCAG (With 20 Examples)
Good alt text says what the image is for in that spot on the page, in a short phrase, without starting "image of". Images that carry meaning need a text alternative. Purely decorative images get an empty alt attribute (alt="") so screen readers skip them. This is what WCAG 1.1.1 Non-text Content requires, and the examples below show what passes and what does not.
Alt text is judged by a person. Automated tools can check that an alt attribute exists, but not whether the words are right.
What does WCAG require for alt text?
WCAG 1.1.1 Non-text Content (Level A) says that non-text content that is presented to the user has a text alternative that serves the equivalent purpose. There are exceptions for decorative images, and different treatment for controls, time-based media, tests, sensory experiences and CAPTCHAs.
Two related criteria matter:
- 1.4.5 Images of Text (AA). Use real text, not a picture of text, unless the look is essential, such as a logo.
- 2.4.4 Link Purpose (In Context) (A). When an image is the only content of a link, its alt text provides the link name.
WCAG sets no character limit. Many writers aim for a short phrase or one sentence, and some screen readers handle very long alt text poorly. Use a longer description elsewhere when an image needs one.
What is the basic test for alt text?
Ask: if the image disappeared, what would a reader miss, and what words would replace it in this context?
The same photo can need different alt text in different places. A photo of a chef is described one way in a restaurant's "Meet the team" page and another way in a news story about an award.
How do you write alt text, step by step?
- Decide the image's job. Informative, decorative, functional (a link or button), text, or complex.
- Write what matters in this context. Not everything you can see.
- Keep it short. A phrase or a sentence.
- Leave out "image of", "picture of" and "photo of". Screen readers already announce an image.
- Do not repeat nearby text. If a caption says it already, use short alt text or none.
- Test with a screen reader or by reading the alt text aloud without the image.
When should alt text be empty?
Use alt="" when an image adds no information:
- Purely decorative flourishes, dividers and background textures.
- Images that repeat nearby text, such as an icon next to a label that says the same thing.
- Spacer images, if they still exist.
<img src="divider.svg" alt="">
An empty alt is not the same as a missing alt. If the attribute is missing, some screen readers read the file name. Always include the attribute.
What are 20 examples of good and bad alt text?
| # | Image and context | Bad alt text | Good alt text |
|---|---|---|---|
| 1 | Photo of a product, a blue ceramic mug, on a shop page | image1.jpg | Blue ceramic mug with a wide handle |
| 2 | Product photo, where the name is already in the heading beside it | Mug mug mug blue ceramic cheap mug | Blue ceramic mug, front view |
| 3 | Staff photo on a team page, Priya Rao, designer | Photo | Priya Rao, designer |
| 4 | Decorative wave pattern behind a heading | Blue wave pattern | alt="" (empty alt) |
| 5 | Logo that links to the home page | Logo | Acme home |
| 6 | Logo in the page footer, not linked | Image of Acme logo | Acme |
| 7 | Magnifying glass icon on a search button | Magnifying glass | Search |
| 8 | Shopping cart icon link | Cart icon | Cart, 3 items |
| 9 | Social media icon link | Icon | Follow us on LinkedIn |
| 10 | Icon next to the visible text "Download PDF" | PDF icon | alt="" (empty, the text already says it) |
| 11 | Banner with the text "Summer sale, 20% off" | Banner | Summer sale: 20% off all sandals |
| 12 | Bar chart showing sales by quarter | Chart | Bar chart: sales rose each quarter, from 120 in Q1 to 210 in Q4. Data table below. |
| 13 | Map showing a shop location | Map | Map showing the shop on Station Road, two blocks east of the bus stand |
| 14 | Screenshot of a settings page in a tutorial | Screenshot | Settings page with the "Notifications" toggle switched on |
| 15 | News photo of a flood, in an article about the flood | Flood | Residents wade through knee-deep water on a flooded street |
| 16 | Infographic with many steps | Infographic about recycling | Recycling steps: rinse, sort, place in the right bin. Full steps listed below. |
| 17 | Photo in a gallery, with a visible caption | Beautiful sunset over the sea | Sunset over the harbor (or empty, if the caption says the same) |
| 18 | Image used as a "Submit" button | button.png | Submit |
| 19 | Author avatar next to a visible author name | Avatar | alt="" (empty alt) |
| 20 | Photo of a recipe result, in a recipe post | Delicious!!! | Finished lentil soup in a white bowl, topped with parsley |
Context changes the answer, so treat these as models and not rules.
How do you handle images that are links or buttons?
When an image is the only content of a link or button, the alt text should describe where it goes or what it does, not what it looks like.
<a href="/cart">
<img src="cart.svg" alt="Cart, 3 items">
</a>
If a link contains both an image and text, and the text already says it, leave the image's alt empty to avoid repeating:
<a href="/report.pdf">
<img src="pdf-icon.svg" alt="">
Download the annual report (PDF)
</a>
How do you handle charts, graphs and complex images?
A short alt text cannot hold a whole chart. Use two layers:
- Short alt text that names the image and its main point.
- A longer description or the data in the page text, a table or a linked page.
<figure>
<img src="sales.png" alt="Bar chart: quarterly sales rising from 120 to 210. Details in the table below.">
<figcaption>Quarterly sales, 2026</figcaption>
</figure>
<table>
<!-- data table here -->
</table>
How do you handle images of text?
If an image contains text, put the same text in the alt text, and ask whether you can use real text instead (1.4.5). Logos are an allowed exception.
What about SVG and CSS background images?
- Inline SVG that carries meaning needs a text alternative, such as
role="img"with anaria-label, or a<title>. Decorative SVG should be hidden witharia-hidden="true". - CSS background images have no alt text. Use them only for decoration. If the image carries meaning, use an
<img>element.
<svg role="img" aria-label="Warning" width="16" height="16">...</svg>
<svg aria-hidden="true" width="16" height="16">...</svg>
What mistakes should you avoid?
- File names as alt text, such as
IMG_2043.jpg. - "Image of" or "picture of" at the start.
- Keyword stuffing for search. Write for people first. Clear alt text also helps search engines understand the image.
- Repeating the caption word for word.
- Describing the pixels, not the purpose, such as "man in blue shirt" when the point is "our CEO, Ravi Kumar".
- Leaving the alt attribute off, which is different from an empty one.
- Using alt text as a tooltip. Use the
titleattribute only with care, and do not rely on it.
How do you check alt text on a site?
- Run an automated scan to find missing alt attributes. See the best free accessibility testing tools.
- Review alt text by reading it aloud without the image. Does it make sense in context?
- Test key pages with a screen reader.
- Add alt-text guidelines for editors, and check new uploads.
An automated audit cannot tell whether alt text is accurate or useful. Kerbwise audits the page you have open against WCAG 2.2 Level A and AA and ranks accessibility issues by severity, with the WCAG number, who is affected and how to fix each one, but alt text quality still needs a human review. See how to run a website accessibility audit for the full process, and the WCAG 2.2 AA checklist for every criterion.
Try Kerbwise on a page you own
Try Kerbwise ($29 one-time) to run this audit locally and export a client-ready PDF report. Get it on the Chrome Web Store or read more on the Kerbwise page.
Frequently asked questions
How long should alt text be?
WCAG sets no limit. Aim for a short phrase or a sentence. Put long descriptions in the page text and link or refer to them.
Should I start alt text with "image of"?
No. Screen readers already say that it is an image, so the words add noise.
What should I put as alt text for decorative images?
Use an empty alt attribute, alt="", so screen readers skip the image.
Do I need alt text for logos?
Yes, unless the logo is decorative in context. A logo that links home needs alt text that describes the destination, such as "Acme home".
Does alt text help SEO?
It can help search engines understand an image, but write for people first. Keyword stuffing makes alt text worse for screen reader users.