Skip to Content
Component ExamplesImages & Alt Text

Overview

Images are one of the most fundamental forms of non-text content on the web. For sighted users, images convey information instantly. For screen reader users, the alt attribute is the only way to understand what an image represents. Missing alt text causes screen readers to read the filename, while incorrect alt text on decorative images creates unnecessary noise.

WCAG Criteria:

Key requirements:

  • Every <img> must have an alt attribute — omitting it entirely causes screen readers to read the filename
  • Informative images need descriptive alt text that conveys the same information as the image
  • Decorative images must use alt="" (empty) so screen readers skip them entirely
  • Functional images (inside links or buttons) describe the purpose, not the appearance
  • Complex images use aria-describedby to point to a longer visible description

Informative Image

Informative Image with Alt Text

Inaccessible
<!-- No alt attribute at all — screen reader reads filename --> <img src="dog-park.jpg" /> <p>A dog playing in the park.</p>
Live Preview

A dog playing in the park.

Accessible
<!-- Descriptive alt conveys the image content --> <img src="dog-park.jpg" alt="A golden retriever catching a frisbee in a park" /> <p>A dog playing in the park.</p>
Live Preview
A golden retriever catching a frisbee in a park

A dog playing in the park.

What’s wrong without an alt attribute?

  • The screen reader reads the image filename (e.g. “dog-park.jpg, image”) — meaningless noise
  • This is different from alt="" — a missing alt attribute is never correct
  • Users have no way to know what the image depicts

What the screen reader announces:

VersionAnnouncement
Inaccessible (no alt)“dog-park.jpg, image” (reads the filename)
Accessible (alt text)“A golden retriever catching a frisbee in a park, image”

Decorative Image

Decorative Image Handling

Inaccessible
<!-- alt="decorative border" adds noise — screen reader reads it aloud --> <h3>Section Title</h3> <img src="divider.png" alt="decorative border" /> <p>Content below the decorative divider.</p>
Live Preview

Section Title

decorative border

Content below the decorative divider.

Accessible
<!-- alt="" tells screen readers to skip this image entirely --> <h3>Section Title</h3> <img src="divider.png" alt="" /> <p>Content below the decorative divider.</p>
Live Preview

Section Title

Content below the decorative divider.

What’s wrong with alt text on decorative images?

  • Screen readers announce “decorative border, image” — this adds no useful information
  • Decorative images exist purely for visual styling and carry no meaning
  • Using alt="" (empty string) explicitly marks the image as decorative — the screen reader skips it completely
  • This is different from omitting alt entirely, which causes the filename to be read

What the screen reader announces:

VersionAnnouncement
Inaccessible (alt="decorative border")“decorative border, image” (unnecessary noise)
Accessible (alt="")(nothing — image is skipped entirely)

Functional Image

Functional Image Inside a Link

Inaccessible
<!-- Image inside a link with no alt — user hears just "link" --> <a href="/search"> <img src="search-icon.svg" /> </a>
Live Preview
Accessible
<!-- alt describes the action, not the appearance --> <a href="/search"> <img src="search-icon.svg" alt="Search" /> </a>
Live Preview

What’s wrong without alt text on functional images?

  • The link has no accessible name — the screen reader announces just “link” with no indication of where it goes
  • Users cannot determine the purpose of the link without seeing the icon
  • For functional images, the alt text should describe the purpose (e.g. “Search”), not the appearance (e.g. “magnifying glass icon”)

What the screen reader announces:

VersionAnnouncement
Inaccessible (no alt)“link” (no purpose conveyed)
Accessible (alt="Search")“Search, link”

Resources