Web development and performance
What is Alt text?
Alt text is the text alternative for an image, read aloud by screen readers and used by search engines to understand what the image shows. Every img element needs the attribute; decorative images take an empty value so assistive technology skips them.
Also called: alternative text · alt attribute
What to write, by case
| Case | What to write |
|---|---|
| Informative image | What it shows, as a normal phrase |
| Image that is a link | Where the link goes, not what the picture is |
| Decorative image | alt="" — empty, never omitted |
| Image containing text | The text itself, verbatim |
| Product photo | Product name plus the distinguishing detail |
Why omitting the attribute is worse than an empty one
With alt="" a screen reader skips the image silently. With no alt attribute at all, many screen readers announce the filename — so a user hears "I M G underscore 4 4 7 1 dot j p g", which is worse than nothing.
The SEO angle, honestly stated
Alt text helps image search directly and contributes modestly to what a page is understood to be about. Its primary purpose is accessibility, and writing it properly for that purpose produces the best version for search anyway. Keyword-stuffed alt text fails both.
Where this is covered in depth
A definition can only go so far. Image SEO: findable images that do not wreck your page speed covers this properly — 3 minutes, free, no email required.
Who wrote this
Anas Bin Masud builds e-commerce sites and does technical SEO for businesses in the UK, Canada and Pakistan. These definitions come from client work rather than from a content brief — where an entry describes a mistake, it is usually one found on a real site. More about how I work.