What Is Alt Text? How to Write It for SEO and Accessibility
Alt text (short for alternative text) is a brief written description of an image, added to the image's alt attribute in your page's HTML. It does two jobs at once: it lets people who use screen readers understand what an image shows, and it gives search engines a clear clue about the image's content. Good alt text is specific, accurate and short.
In practice, that means describing what the image shows in plain words, the way you would explain it to someone over the phone, and leaving it empty when the image is purely decorative. This guide explains how to write alt text, with good and bad examples, plus the mistakes to avoid.
What Is Alt Text?
Alt text is a line of text attached to an image in your site's code. A typical image tag looks like this:
<img src="red-kayak-on-lake.jpg" alt="Red kayak resting on a calm lake at sunrise">
Visitors do not normally see alt text. It appears if the image fails to load, and screen readers read it aloud for people who are blind or have low vision. Search engines read it too.
Why Alt Text Matters for SEO and Accessibility
According to Google's image guidance, alt text is the most important piece of metadata for an image. Google combines it with computer vision and the text around the image to work out what the picture is about. If an image is also a link, the alt text acts like anchor text for that link.
The accessibility reason matters just as much. For many readers, the alt text is the only way to know what an image contributes. Writing it well makes your site usable for more people, and that is a good enough reason by itself.
How to Write Good Alt Text: 6 Rules
- Describe what is actually in the image. Name the subject and what it is doing.
- Be specific, not generic. "Dog" is weaker than "Golden retriever catching a frisbee in a park".
- Keep it short. One clear sentence or phrase is usually enough.
- Fit the page's context. The same photo may need different alt text on different pages, depending on why it is there.
- Use your keyword only if it fits naturally. Never force it in.
- Skip "image of" and "picture of". Screen readers already announce that it is an image.
Good vs Bad Alt Text Examples
The difference is easiest to see side by side.
| Approach | Example alt text | Verdict |
|---|---|---|
| Missing | (no alt attribute) | Gives no information |
| Too generic | "coffee" | Vague |
| Keyword stuffed | "coffee shop best coffee cheap coffee near me" | Looks like spam |
| Specific and natural | "Barista pouring milk into a latte at a wooden counter" | Clear and useful |
Google specifically warns that packing alt attributes with keywords hurts the user experience and can make a site look like spam.
Which Images Need Alt Text? A Simple Decision Guide
Not every image deserves a description. The W3C accessibility guidance sorts images by their role on the page:
- Informative images (photos or simple graphics that add meaning): write a brief description that conveys that meaning.
- Decorative images (purely visual flourishes, or images that repeat nearby text): leave the alt attribute empty, written as
alt="". Screen readers will then skip it. - Functional images (an image used as a button or link): describe the action or destination, such as "Download the price list".
- Complex images (charts and detailed diagrams): give a short summary in alt, and put the full information in the page text nearby.
- Images of text: if the words are not written anywhere else on the page, include them in the alt text.
An empty alt attribute and a missing alt attribute are not the same thing. Empty tells assistive tools to skip the image on purpose. Missing leaves them guessing.
Alt Text for Different Kinds of Websites
Blogs and articles
Describe what the image shows and why it is there. A screenshot in a tutorial should say what the screenshot demonstrates, such as "Search Console performance report filtered to the last 28 days".
Online shops
Product photos should name the product, colour, and any detail a shopper would care about, such as "Navy cotton hoodie, front view". Use a distinct description for each angle.
Logos
For a logo, use the business name, for example "Northside Bakery logo". If the logo links to your home page, you can say so.
Image File Names and Formats Also Help
Alt text works best alongside other basics. Google notes that short, descriptive file names give light hints about an image's subject, so red-kayak-on-lake.jpg is better than a camera default like IMG_4021.jpg. Google Search supports BMP, GIF, JPEG, PNG, WebP, SVG and AVIF images, and the file extension should match the real format.
Large images can also slow a page down, which affects the experience visitors have. Our guide to Core Web Vitals explains how loading speed is measured and why it matters.
Common Alt Text Mistakes
- Leaving every image without alt text because "nobody sees it".
- Copying the same alt text onto every image on a page.
- Stuffing keywords or lists of search terms into the attribute.
- Writing long paragraphs when a short phrase would do.
- Describing decorative images, which adds noise for screen reader users.
- Using the file name as alt text, such as "IMG_4021".
How to Add Alt Text in WordPress and Other Platforms
Most website tools have a field for it. In WordPress, click the image and fill in the "Alternative Text" box in the sidebar. Shopify, Wix, Squarespace and similar platforms all provide an alt text or "image description" field in their image settings. If you edit raw HTML, add the alt attribute directly to the image tag as shown earlier.
If your site already has hundreds of images, do not try to fix everything in one sitting. Start with your most visited pages and your most important images, then work outward. Pairing this with good internal linking helps those pages perform better overall.
Frequently Asked Questions
How long should alt text be?
Short. A single phrase or sentence that describes the image is usually enough. There is no magic number, so focus on clarity.
Does alt text help SEO?
Yes. Google uses it, together with the page content, to understand images, and it can help your images appear in image search.
Should I put keywords in alt text?
Only if they describe the image naturally. Forcing keywords in can make your site look spammy.
What is alt text for decorative images?
Leave it empty (alt="") so screen readers skip the image.
Do I need alt text on every image?
Every image should have an alt attribute, but it can be empty when the image is purely decorative.
The Bottom Line
Write alt text for people first: describe the image clearly and briefly, and search engines benefit as a side effect. If you would like help improving the SEO and accessibility basics on your own site, you are welcome to get in touch.