Alt Text & Accessibility

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 #accessibility #image seo

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 imageWhat it doesWhat the alt text should doExample
InformativeAdds information to the pageDescribe what the image shows or saysalt="Bar chart: organic clicks rose from 1,200 to 3,400 between January and June"
DecorativeOnly adds visual styleBe empty, so screen readers skip italt=""
FunctionalIs a button or linkDescribe what happens, not what it looks likealt="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

ImageWeak alt textBetter alt text
Photo of a productIMG_2043.jpgBlue ceramic coffee mug with a wooden handle
Photo of a person at workphotoTechnician checking a router in a server closet
Logo that links to the home pagelogoSeckRates home
A divider line between sectionsdivider linealt="" (empty on purpose)
Photo stuffed with keywordscheap mug best mug buy mug onlineBlue ceramic coffee mug with a wooden handle

How to write good alt text

  1. Describe the purpose, not just the picture. Ask what a visitor would miss if the image were gone, and say that.
  2. 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.
  3. Skip “image of” and “picture of”. Screen readers already announce that it is an image.
  4. Do not stuff keywords. Use a relevant term only where it truly describes the image.
  5. 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.
  6. 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.

Sources

  1. W3C WAI: Images Tutorial
  2. W3C WAI: An alt Decision Tree
  3. W3C: Understanding Success Criterion 1.1.1 Non-text Content (WCAG 2.2)
  4. Google Search Central: Google Images SEO best practices