Alt text: describing images for people and search engines

Person using a screen reader with headphones at a laptop

How to write alt text that helps people using screen readers, when to leave it empty, and why stuffing it with keywords backfires.

Alt text is the short written description attached to an image on a web page. Most visitors never see it, but for some it is the only way to know what the picture shows.

Who alt text is for

People who are blind or have low vision often use screen readers, which read the page aloud. When the screen reader reaches an image, it reads the alt text. Without it, the visitor hears nothing useful, or sometimes the file name, which is rarely helpful.

Alt text also appears if an image fails to load, and search engines use it to understand what an image shows.

Photographer reviewing product photographs on a monitor

How to write it

Describe what the image shows, in the context of the page, as you would to someone on the phone. Keep it to a sentence. "Engineer fitting a new boiler in a kitchen" tells the listener far more than "boiler" or "image of a boiler".

There is no need to start with "photo of" or "picture of", because the screen reader already announces that it is an image.

When to leave it empty

Some images are purely decorative, such as a pattern or a divider line. These should have an empty alt attribute, written as alt="", so screen readers skip them. Leaving the attribute out completely is different: many screen readers will then read out the file name instead.

Images that do a job

If an image is a link or a button, the alt text should say what it does rather than what it looks like. A magnifying glass icon used for search should have alt text such as "Search", not "magnifying glass".

Close view of a keyboard with braille labels

Avoid stuffing it with keywords

Repeating search phrases in alt text does not help rankings and makes the page unpleasant to listen to. Search engines are good at spotting it. An honest, specific description is better for visitors and for search.