Deutsch
Headings, images & media

Alt text

Also known as: alt attribute, alternative text, alt tag, image alt text

Alt text (alternative text) is a short written description of an image, placed in the alt attribute of an HTML img element. Screen readers read it aloud, browsers display it when the image fails to load, and search engines use it to understand what the image shows.

At a glance

Type
HTML attribute alt on the img element
Affects
screen readers, Google Images, anchor text of image links
Decorative images
alt="" (empty)

Last checked:

What is alt text used for?

Accessibility. WCAG success criterion 1.1.1 (Level A) requires a text alternative for all non-text content that serves the equivalent purpose. Images that are purely decorative should be marked up so assistive technology can skip them. In the US, Section508.gov lists alt text as a requirement of the Section 508 standards for federal digital content.

Fallback. If an image cannot be loaded, for example because of a network error or a broken path, the browser shows the alt text in its place.

SEO. Google calls alt text the most important attribute for giving more metadata about an image. Google combines it with computer vision and the surrounding page content to understand the image’s subject. When an image is used as a link, Google treats its alt text as the link’s anchor text. Images added only through CSS are not indexed by Google, so an image that should appear in Google Images needs a real img element.

The common term “alt tag” is technically imprecise. alt is an attribute of the img element.

How to write good alt text

Describe what the image contributes in its context, as briefly as possible. The same photo may need different alt text on a product page and in a news article. WebAIM recommends a few words, rarely more than a sentence or two, and advises against openings like “image of” because screen readers already announce that an image is present. If the image contains text, repeat that text. For complex graphics such as charts, keep the alt text short and put the full explanation in the body copy or a linked description.

Example

HTML
<!-- Informative image: describe what matters -->
<img src="cargo-bike-red.jpg"
     alt="Red longtail cargo bike with two child seats, parked by a brick wall">

<!-- Decorative image: empty alt so screen readers skip it -->
<img src="wave-divider.svg" alt="">

<!-- Image as the only link content: describe the destination -->
<a href="/cart/">
  <img src="icon-cart.svg" alt="View cart">
</a>

Common mistakes

  • Missing alt attribute. Some screen readers then read out the file name, which is rarely helpful.
  • Keyword stuffing. Google says alt attributes filled with keywords create a poor user experience and may cause a site to be seen as spam.
  • Describing decoration. Ornamental graphics need alt="". A description only adds noise for screen reader users.
  • Empty alt on linked images. The link then has no accessible name, and Google has no anchor text for it.
  • Unreviewed automatic descriptions. Section508.gov advises against relying on default or AI-generated alt text.

FAQ

What does alt text mean? It is the text alternative for an image, stored in the alt attribute. It stands in for the image when someone cannot see it.

Is alt text legally required? Section508.gov lists alt text as a requirement of the Section 508 standards, which apply to US federal digital content. WCAG success criterion 1.1.1 (Level A) asks for a text alternative for non-text content.

This is not legal advice.

Can AI write alt text? Section508.gov advises avoiding default or AI-generated alt text, because such descriptions usually do not communicate the actual purpose of the image. A person should review and edit any draft before publishing.

Does every image need alt text? Every img element needs an alt attribute. For purely decorative images it stays empty.

Sources

  1. Google image SEO best practices – Google Search Central (last updated 2026-03-02)developers.google.com
  2. SEO link best practices for Google – Google Search Centraldevelopers.google.com
  3. Understanding Success Criterion 1.1.1: Non-text Content – W3C WCAG 2.2w3.org
  4. Decorative Images – W3C WAI Images Tutorialw3.org
  5. <img>: The Image Embed element – MDNdeveloper.mozilla.org
  6. Alternative Text – WebAIM (secondary source)webaim.org
  7. What is Alternative Text? – Section508.govsection508.gov

Last updated: