Alt text is the short description that stands in for an image when someone can't see it. Here's how to write it, when to leave it empty, and examples you can reuse.
Quick answer
Alt text (alternate text) is a text alternative that replaces an image for people who can't see it. Screen readers read it aloud, and search engines can read it too. Good alt text describes what the image means on your page, usually in a short phrase or sentence. Purely decorative images get an empty alt attribute (alt="") so screen readers skip them. Alt text is covered by WCAG success criterion 1.1.1, at Level A, the lowest conformance level.
What is alt text?
Alt text is a short written description that replaces an image when the image can't be seen. It's also called alternate text or alternative text, after the HTML alt attribute that holds it.
The HTML standard gives a simple test: replacing every image with its alt text should not change the meaning of the page. In code, it looks like this:
<img src="jumper.jpg" alt="Red wool jumper with a cable-knit pattern">
You rarely need code. If your website editor has an alt text or image description field, the text goes there.
Why does alt text matter?
Alt text makes the information in your images available to people who can't see them. Screen readers read it aloud or show it in braille. It also helps mobile users who switch images off to save data.
It's a baseline requirement. WCAG success criterion 1.1.1 requires a text alternative for all non-text content, with a few exceptions such as pure decoration. Our complete guide to WCAG explains the levels and principles.
The European Accessibility Act requires websites to be "perceivable", and text alternatives are the first WCAG guideline under that principle. Penalties are set nationally: see EAA fines by country.
There's a search angle too. The W3C notes that text alternatives make images indexable by search engines. That gives search engines text to understand your images, but it doesn't guarantee rankings. Our article on accessibility and SEO covers where the two overlap.
How to write good alt text
Write what the image means in its context, as you'd describe it to someone over the phone. That phone test comes from the HTML standard. Six rules cover most images:
- Describe the purpose, not every pixel. A stock photo of a happy family can simply say "We're family-friendly", if that's the impression it's there to give.
- Let context decide the detail. The W3C's example: a bird's exact species may not matter on a parks website, but it does on a bird website.
- Keep it short. A short phrase or sentence is enough for most images. Neither WCAG nor the HTML standard sets a character limit.
- Skip "image of" and captions. The HTML standard says to describe the content without mentioning that there is an image. Don't repeat a caption or nearby text either.
- Copy the words in images of text. If a banner says "20% off all coats", the alt text says the same.
- For links and buttons, describe the action. A printer icon gets "Print this page", not "Printer". A magnifying glass on a search button gets "Search".
Never use a file name or a placeholder like "image". The W3C lists both as failures of WCAG 1.1.1.
When should alt text be empty?
Alt text should be empty (alt="") when an image is purely decorative or repeats text already on the page. An empty alt tells screen readers to skip the image.
Typical examples: borders, spacers, mood photos and icons next to link text that says the same. Whether an image is decorative is a judgement only the author can make, based on why it's on the page.
Don't leave the alt attribute out altogether. The W3C notes that some screen readers then announce the file name instead.
Not sure? The W3C's alt decision tree comes down to four questions:
- Does the image contain text? Put the same words in the alt text, unless they're already on the page.
- Is it a link or a button? Describe where it goes or what it does.
- Does it add meaning? Write a short description. For charts, also give the full information on the page.
- Is it purely decorative? Use alt="".

Alt text examples
The same rules give very different alt text depending on the image's job. Common cases on business websites:

| Image | Bad alt text | Good alt text |
|---|---|---|
| Product photo of a red wool jumper on a shop page | jumper-final-2.jpg | Red wool jumper with a cable-knit pattern, front view |
| Magnifying glass icon on a search button | Magnifying glass | Search |
| Company logo that links to the homepage | Logo | [Company name] home |
| Homepage banner reading "20% off all coats until Sunday" | Sale banner | 20% off all coats until Sunday |
| Bar chart of sign-ups by quarter in a report | Chart | Bar chart of sign-ups by quarter, figures in the table below |
| Decorative wave line between page sections | Blue wave divider | (empty: alt="") |
Can an alt text generator write it for you?
Automated alt text suggestions can describe what's in a picture, but they can't know why it's on your page. The W3C says the author determines the text alternative, based on usage, context and content.
Treat a suggestion as a first draft at most. Check it matches the image's purpose, cut detail nobody needs, and ask whether the image is decorative instead.
Automated checks have the same limit: the HTML standard notes they can't tell phony alt text from correct alt text. Run a page through our free accessibility checker, then review the wording yourself.
What this means for your business
- Start with your key pages. Product pages, the homepage and campaign landing pages come first.
- Make alt text part of publishing. Whoever uploads an image writes its alt text, or marks it as decorative.
- Brief your agencies. Ask for alt text with every image, banner and chart they deliver.
- Keep important text out of images. Real text can be resized and restyled without losing clarity.
- Check regularly. Accessibility monitoring catches new problems as your site changes.
Frequently asked questions
What does alt text mean?
Alt text means alternative text: the description in an image's HTML alt attribute that screen readers read instead of the image.
How long should alt text be?
There's no fixed limit in WCAG or the HTML standard. A short phrase or sentence works for most images. Charts and diagrams need a longer description on the page itself.
Can I use an alt text generator?
As a starting point only. A person still has to check the text fits the image's purpose on that page.
How do I add alt text to social media posts?
If the platform offers an alt text or image description option, use it. The same rules apply: describe the point of the image and include any text shown in it.
Does alt text help SEO?
It gives search engines text to understand your images. It's not a ranking guarantee.
Related
- How web accessibility helps your SEO: where accessibility and search overlap
- The complete guide to WCAG: the standard behind success criterion 1.1.1
- EAA fines by country: the penalties in all 27 EU states
- Official guidance: W3C WAI Images Tutorial
Sources: WCAG 2.2, success criterion 1.1.1 Non-text Content (W3C); W3C WAI Images Tutorial and alt decision tree; HTML Living Standard, section 4.8.4.4 (WHATWG).



