Free, independent guides since 2010

Accessibility

Writing good alt text for images

How to write alternative text for images: describing purpose and content, length, decorative images, linked images, charts and infographics, images of text, logos and common mistakes.

<guide section="Accessibility" type="article" read="1 min"/>

Alt text is read aloud by screen readers, shown when images fail to load and used by search engines (see the alt attribute and SEO). Good alt text is not a list of keywords – it is a short, useful description.

Ask: why is this image here?

ImageGood alt text
Photo of a mechanic repairing an e-bike, on a repairs pageMechanic replacing the chain of an e-bike in our Ghent workshop
Same photo, on a team pageSarah, our e-bike specialist, at work
Product photoBlack waterproof rear pannier, 20 litres, with roll-top closure
Decorative divideralt=""
Logo linking to the homepagedom4j.org home
Icon button (magnifier)Search

Rules of thumb

  • Describe content and function, not appearance alone.
  • Be concise: usually under 150 characters.
  • Do not repeat the caption or surrounding text word for word.
  • For linked images, describe the destination.
  • Avoid images of text; if unavoidable, the alt text contains the text.

Charts and infographics

Give a short alt text with the main message (“Bar chart: mobile visits grew from 40% to 68% between 2020 and 2026”) and provide the data or a full description in text or a table nearby.

In code

HTML
<img src="workshop.jpg" alt="Mechanic replacing the chain of an e-bike in our Ghent workshop" width="1200" height="800">
<img src="divider.svg" alt="">
<button type="button"><svg aria-hidden="true">…</svg><span class="visually-hidden">Search</span></button>

Frequently asked questions

Should alt text start with “image of”?

No. Screen readers already announce that it is an image. Start with the content.

Can AI write my alt texts?

AI can suggest descriptions, but it does not know why the image is on your page. Review every suggestion and adapt it to the context.