What Is Alt Text? A Simple Guide With Examples
Alt text is a short written description of an image. Learn what it is, why it matters for accessibility and SEO, and how to write it, with examples.
By Franel II Romanillos, Technical SEO Specialist
Alt text (alternative text) is a short written description of an image, added to a web page with the alt attribute of the img element. Screen readers read it aloud for people who cannot see the image, browsers show it when an image fails to load, and search engines use it, together with the rest of the page, to understand what the image shows.
Here is what it looks like in HTML:
<img src="harbor.jpg" alt="Wooden lobster traps stacked on a dock beside a harbor full of boats">
The visitor sees the photo. Someone using a screen reader hears the text in the alt attribute instead.
Why alt text matters
- Accessibility. People who are blind or have low vision rely on text alternatives to understand images. Providing them is a basic requirement of the Web Content Accessibility Guidelines (WCAG), under success criterion 1.1.1 at Level A.
- Search. Google says it uses alt text, along with computer vision and the content of the page, to understand an image. Descriptive alt text helps your images make sense in Google Images and in regular results. It is one signal among many, not a ranking trick.
- Fallback. If an image cannot load because of a slow connection or a broken file, the alt text appears in its place.
- Links. When an image is the only content of a link, its alt text acts as the link’s description, much like anchor text.
The three kinds of images
The W3C’s accessibility guidance sorts images by their purpose. The right alt text depends on which kind you have.
| Type of image | What it does | What the alt text should do | Example |
|---|---|---|---|
| Informative | Adds information to the page | Describe what the image shows or says | alt="Bar chart: organic clicks rose from 1,200 to 3,400 between January and June" |
| Decorative | Only adds visual style | Be empty, so screen readers skip it | alt="" |
| Functional | Is a button or link | Describe what happens, not what it looks like | alt="Search" on a magnifying glass button |
Images of text should repeat the text. Complex images such as detailed charts usually need a short alt text plus a longer description in the page itself.
Good and weak alt text
| Image | Weak alt text | Better alt text |
|---|---|---|
| Photo of a product | IMG_2043.jpg | Blue ceramic coffee mug with a wooden handle |
| Photo of a person at work | photo | Technician checking a router in a server closet |
| Logo that links to the home page | logo | SeckRates home |
| A divider line between sections | divider line | alt="" (empty on purpose) |
| Photo stuffed with keywords | cheap mug best mug buy mug online | Blue ceramic coffee mug with a wooden handle |
How to write good alt text
- Describe the purpose, not just the picture. Ask what a visitor would miss if the image were gone, and say that.
- Be specific and concise. A short phrase or one sentence is usually enough. There is no official length limit, so keep it as short as it can be while still doing the job.
- Skip “image of” and “picture of”. Screen readers already announce that it is an image.
- Do not stuff keywords. Use a relevant term only where it truly describes the image.
- Use an empty
alt=""for decoration. An empty attribute is a deliberate signal. A missing attribute is a mistake, because some screen readers then read out the file name. - Do not repeat the caption. If the text next to the image already says the same thing, shorter alt text, or an empty one, may be better.
How to check the alt text on your site
You can look at a page’s HTML by hand, but it is faster to use a checker. Paste a page into the Alt Text Checker to see every image on it with a thumbnail, its alt text, and whether the alt attribute is missing or empty. To count images with missing or empty alt text across a whole site, crawl it with the Page Audit Checker.
When the checker flags an image, decide which of the three types it is. Empty alt text on a decorative image is correct. Empty alt text on a chart or a product photo is a problem.
Frequently asked questions
What is alt text in simple terms?
It is a short text version of an image. People who cannot see the image, and software such as search engines, use it to know what the image is about.
Is alt text the same as a caption?
No. A caption is visible text that appears near the image for everyone. Alt text is hidden from sighted visitors unless the image fails to load, and it is read by assistive technology. They can work together, but they should not just repeat each other.
Is alt text the same as the title attribute?
No. The title attribute is extra advisory text that browsers may show as a tooltip, and it is not reliably read by screen readers. Always use alt, and treat title as optional.
Do all images need alt text?
Every img element should have an alt attribute. Meaningful images get descriptive text, and decorative images get an empty one (alt="").
Does alt text help SEO?
It helps search engines understand your images, which supports image search, and it makes your pages more useful. It is not a shortcut to higher rankings, and stuffing keywords into it can hurt rather than help.
How long should alt text be?
There is no fixed limit. Write the shortest text that conveys the purpose of the image, often a short phrase or a single sentence.