Cosmic Hub

Image Alt Text: How to Write It for Accessibility and SEO

Updated · 5 min read · By Alpha Ross, multimedia creator & website builder

Image Alt Text: How to Write It for Accessibility and SEO

Alt text is a short written description of an image, stored in the page's code. Screen readers read it aloud to people who cannot see the picture, browsers show it when the image fails to load, and search engines use it to understand what the image shows. Good alt text is accurate, brief and written for a person first.

Why alt text exists

Many visitors do not see your images the way you do. Some use screen readers because they are blind or have low vision. Some are on a slow connection where pictures do not load. Some use a text-only browser. For all of them, the alt text is the image. If it is missing, a screen reader often announces the file name, which is usually meaningless, such as a string of letters and numbers.

What to write

Ask yourself: if I could not show this picture, what would I say to a friend to give them the same information? Write that. Describe what matters in the context of the page, not every detail.

Examples: weak and strong

SituationWeakBetter
Product photoIMG_2041.jpgBlue ceramic mug with a wide handle on a wooden table
Team phototeamFour colleagues laughing around a laptop in the studio
ChartchartBar chart: visits doubled from March to June
Logo linklogoHome page of Harbor Print Shop

When the alt text should be empty

Purely decorative images, such as a divider line or a background flourish, add nothing for a person who cannot see them. For these, leave the alt attribute present but empty. A screen reader then skips the image. Do not remove the attribute entirely, because then the reader may announce the file name. If an image is a link or a button, the alt text should describe where it goes or what it does, not what it looks like.

Complex images need more

A chart, map or infographic often carries information that does not fit in a short description. Give a short alt text that states the main point, and put the details in nearby text or a table on the page. This helps everyone, including people who simply prefer to read numbers. The same idea applies to screenshots that contain steps: describe the point in the alt text and explain the steps in the paragraph around them.

How search engines use alt text

Search engines cannot fully understand every picture, so they use signals around it: the file name, the alt text, the caption and the surrounding text. Descriptive alt text helps your images appear in image search, and it supports the page's topic. Do not stuff it with keywords. A line such as "cheap shoes best shoes buy shoes online" helps nobody and looks like spam, which the guidance in the helpful content checklist discourages.

File names and captions

Give files readable names before uploading, for example "sourdough-class-hands-shaping-dough" rather than a camera number. Use a caption when the picture needs context that all readers will benefit from. A caption is visible to everyone and is read as normal text, while alt text is hidden in the code, so avoid repeating the same sentence in both.

How to audit a whole site

  1. Run a site crawl with a free tool and export the list of images without alt text.
  2. Sort by importance: homepage, key service pages and top articles first.
  3. Decide for each image whether it is informative, functional or decorative.
  4. Write or fix the text, and mark decorative images as empty.
  5. Check again after the next big content update.

You can also test with a screen reader or a browser extension that shows alt text, and navigate your page by listening only. It is an eye-opening exercise and ties in with the points in the colors and contrast guide.

Common mistakes

A quick checklist before you publish

Alt text in product and portfolio pages

On shops and portfolios, images are the content. For a product, name the item, the color, the material and anything visible that a buyer would want to know, such as "Linen cushion cover in rust red, 45 by 45 centimeters, on a grey sofa". For artwork or photography, describe the subject and mood in a sentence, and put the title, medium and year in the visible caption. Each product photo from a different angle should have its own description, for example front view, back view and detail of the zipper, so a shopper using a screen reader can build the same picture as everyone else.

FAQ

Is alt text a ranking factor?

It helps search engines understand images and can help image search, but it is only one of many signals.

How long should alt text be?

Short and clear, often a single phrase and rarely more than about 125 characters.

Should I add keywords?

Only if they naturally describe the image. Never stuff keywords.

What about images of text?

Avoid them where possible. If you use one, repeat the text in the alt attribute or in the page itself.

Do I need alt text on every image?

Every image needs the attribute. Decorative ones should have it empty on purpose.

Your next step: open your five most visited pages, check each image against the "what would I tell a friend" test and rewrite the weak ones.

Read next

Explore more