How to Write Alt Text for Images

By Md Faizan

Published On:

Follow Us

Alt text is the short description hidden inside an image’s HTML tag. You cannot see it on the page, but two audiences depend on it: people who use screen readers, and search engines trying to understand what a picture shows. Get it right and your images become useful to both. Get it wrong — or skip it — and you waste the only text signal an image has.

This guide explains what alt text is, how long it should be, and how to write it for the most common image types on a blog or small business site.

What Is Alt Text?

Alt text is the text in the alt attribute of an <img> tag. It looks like this in HTML:

<img src="sunset-beach.jpg" alt="Sunset over a quiet beach with two fishing boats">

When the image loads normally, visitors never see the alt text. It appears only when the image fails to load, and it is read aloud by screen readers for people who cannot see the image. Google also uses alt text, together with computer vision and the words around the image, to understand what the picture depicts — which is what gets images into Google Images results.

Alt text is not a caption. A caption is visible to everyone and sits next to the image. Alt text replaces the image for people who cannot see it. That difference decides what you write.

Why Alt Text Matters for SEO and Accessibility

Alt text has three real effects, and one effect it does not have:

  • Accessibility: Missing alt text is one of the most common accessibility failures found in automated scans of popular websites. For a screen reader user, an image without alt text is a gap in the page.
  • Google Images: Alt text is one of the clearest signals Google has about what an image shows. Good alt text helps relevant images appear in image search, which can bring traffic a text page alone would not get.
  • Broken images: When an image fails to load, the alt text shows in its place, so the reader still knows what was supposed to be there.

What alt text will not do is rescue a page’s ranking on its own. Google has said alt text is a supporting signal for image search, not a strong ranking factor for regular web results. Keyword-stuffing the alt attribute — writing a list of keywords instead of a description — is treated as spam, not as optimization.

The Formula: Subject, Detail, Context

Most good alt text follows one pattern: subject + key detail + context. Name what the image shows, add the detail that matters for the page, and say where or why it matters. Then stop.

  • Bad: alt="image"
  • Bad: alt="dog"
  • Good: alt="Golden retriever puppy sitting on a grass lawn"
  • Good: alt="Bar chart showing BlogPress traffic rising from 100 to 1,700 users over six weeks"

Aim for 5 to 15 words. That length is long enough to be specific and short enough to listen to. The commonly cited ceiling is about 125 characters: older screen readers could truncate or pause awkwardly past roughly that point. Google sets no hard limit, and accuracy matters more than hitting an exact number, but 125 characters is a good target. If you cannot describe the image in 125 characters, put the extra detail in a caption or in the body text next to the image, not in the alt attribute.

Five Rules for Writing Alt Text

1. Describe the purpose, not the pixels

Write for the job the image does on that page. A product photo needs the product name, color, and key feature. A screenshot needs what the screenshot shows, not a description of every button. A decorative divider needs nothing at all — see rule 5.

2. Skip “image of” and “photo of”

Screen readers already announce that an element is an image. Starting with “image of a dog” makes the listener hear “image, image of a dog.” Start with the subject instead.

3. Use the keyword once, and only where it fits

Include your target keyword in the alt text of one image — ideally the main image near the top of the page — and only when the keyword honestly describes what the picture shows. Alt text is a supporting signal, not a keyword slot. A page about alt text with an image of a checklist can fairly say alt="Alt text checklist showing the 125-character limit". A page about alt text with a stock photo of a laptop cannot fairly stuff the keyword into that photo’s alt text.

4. Be specific, then stop

Name the thing, the key detail, and the context, then stop. “Woman” is too vague. “Woman in a red jacket handing a coffee to a customer at a farmers market stall” is specific. Adding the brand of the jacket, the time of day, and the weather would be noise.

5. Leave decorative images empty — but never remove the attribute

Icons next to a text label, divider lines, background textures, and purely decorative illustrations should have an empty alt attribute: alt="". That tells screen readers to skip them. Never delete the alt attribute entirely: without it, some screen readers read the file name aloud instead, which is worse than silence.

Alt Text by Image Type

Different images need different treatment:

  • Logo: Two to five words. alt="BlogPress" is enough. The company name is the point.
  • Product photo: Name the product, color, and one key feature, in 8 to 15 words.
  • Blog illustration or screenshot: Describe what it shows in 10 to 18 words, tied to the paragraph it sits in.
  • Chart or graph: Give the headline finding in the alt text — for example, “Line chart showing traffic rising from 100 to 1,700 users over six weeks” — and put the full numbers in the body text or a caption. A screen reader user should get the conclusion from the alt text and the data from the page.
  • Image that is also a link: Describe where the link goes, not just what the picture shows. alt="Download the free resume template" beats alt="PDF icon".
  • Icon with a visible label: Empty alt. The label already says what it is.

Common Alt Text Mistakes

  • Leaving alt text blank on informative images. The most common mistake, and the easiest to fix.
  • Writing the file name as alt text. alt="IMG_4829.jpg" helps nobody.
  • Keyword lists. alt="best shoes, cheap shoes, running shoes, buy shoes" is spam, not a description.
  • Repeating the caption word for word. If the caption already says what the image shows, the alt text can be shorter, or the caption can carry the detail while the alt text carries the essentials.
  • Describing every image the same way. Each image on a page should have alt text written for that image, in that spot, for that paragraph.

How to Add Alt Text in WordPress

In the WordPress block editor, click the image, open the block settings on the right, and type the description into the “Alternative text” field. The media library has the same field, so you can also set alt text when you upload an image — but check it per page, because the same image may need different alt text in different places.

If you run a site audit with a tool like Screaming Frog, Ahrefs, or Semrush, it will list every image missing alt text. Yoast SEO and Rank Math also flag images without alt text in their content checks. Fix the missing ones first, then improve the vague ones.

Frequently Asked Questions

How long should alt text be?

Usually 5 to 15 words, or under about 125 characters. Google sets no hard limit — the 125-character figure comes from older screen reader behavior and is best treated as a readability guide. The median alt text on ranking pages is much shorter, around 22 characters, but that reflects how many images are simple product photos and logos. Accuracy matters more than hitting an exact number.

Does alt text help SEO?

Yes, mainly for image search. Google uses alt text to understand what an image shows, which helps it appear in Google Images. It is not a strong ranking factor for regular web results on its own, and keyword-stuffing alt text can hurt.

What should I write for decorative images?

Use an empty alt attribute, alt="". That tells screen readers to skip the image. Do not delete the attribute entirely, and do not write a description of a decoration nobody needs described.

Should every image have alt text?

Every image should have an alt attribute. Informative images get a description; decorative images get an empty one. The attribute itself should never be missing.

Can I use the same alt text for the same image on different pages?

You can, but check whether the image does the same job on each page. The same chart used to make two different points may deserve two different descriptions.

Keep Going: Related BlogPress Guides

Alt text is one small piece of on-page SEO. For the bigger picture, see how to write SEO-friendly blog posts without writing for a checklist and our guide to meta description length, examples and mistakes. If you are starting from scratch, how to start a blog from scratch covers the setup that makes all of this worth doing.

Leave a Comment