Accessibility
How to write good alt text
Describe what the image conveys in the context it appears, in one sentence. Skip "image of" — the screen reader already says it is an image. Decorative images take alt="" so they are announced as nothing at all.
Before you start
- Your images and the pages they appear on
The steps
-
Step 1: Ask what the image is doing there
Informative, decorative, or functional. The answer determines everything else.
-
Step 2: For informative images, describe the information
Not the pixels. "Sales rose 40% between January and June", not "a line chart".
-
Step 3: For decorative images, use alt=""
An empty attribute, not a missing one. Missing alt makes screen readers read the filename.
-
Step 4: For functional images, describe the action
A magnifying glass that submits search gets alt="Search", not alt="magnifying glass".
-
Step 5: Keep it to a sentence
Long descriptions belong in a caption or adjacent text where everyone can read them.
-
Step 6: Do not stuff keywords
It is spam, it is useless to the person listening, and it is trivially detected.
-
Step 7: Test with a screen reader
NVDA on Windows and VoiceOver on Mac are both free. Ten minutes changes how you write alt text permanently.
Context changes the correct answer
The same photograph of a building needs different alt text on an architecture page than on a contact page. On one it is the subject; on the other it is decoration. There is no correct alt text independent of the page.
The SEO angle is real but secondary
Alt text is how image search understands the image, so it does have ranking value. Write it for the person listening and the search benefit follows; write it for search and it serves nobody.
The background behind this
Image SEO: findable images that do not wreck your page speed covers the reasoning in about 3 minutes — free, ungated, written from client work.
Who wrote this
Anas Bin Masud builds e-commerce sites and does technical SEO for businesses in the UK, Canada, Ireland and Pakistan. These procedures are the ones I run on client work, written down rather than invented — including the ones where the honest answer is that the fix is not available on your current hosting.