Skip to main content
Accessibility

Alt Text

  • images
  • screen readers
  • WCAG 2.2

Alt text — short for alternative text — is a written description of an image that is embedded directly in the HTML via the alt attribute. When a screen reader encounters an <img> element, it reads the value of alt aloud so that a person who cannot see the image still receives the information it conveys. When an image fails to load, browsers also display the alt text in its place, which makes it a useful fallback for slow connections and broken links.

Writing good alt text is less about describing pixels and more about conveying the purpose of the image in the context of the page. An icon next to a “Download” button does not need to say “blue down arrow icon” — it probably doesn’t need alt text at all, because the button label already conveys the action.

Why alt text matters

Screen reader users cannot perceive the visual content of an image, and without alt text they have no way of knowing what an image represents. Images that lack alt text become announced as “image” or, worse, as the file name (e.g., “IMG underscore 0423 dot jpg”), which is noise rather than information.

Alt text also benefits:

  • Search engines, which use it to understand image content and improve image search ranking.
  • Users on slow connections, who see the alt text while the image loads.
  • Users who turn off images to save bandwidth or reduce distractions.

How alt text works

There are three broad categories of images, and each requires a different approach:

Informative images

Images that convey information not already present in the surrounding text need a concise description of what the image is communicating.

Decorative images

Purely decorative images — dividers, background textures, flourishes — should use an empty alt="". This tells screen readers to skip the image entirely. Omitting alt altogether is not the same: screen readers may then announce the file name.

Functional images

Images used as links or buttons need alt text that describes the action, not the image. For a magnifying-glass icon inside a search button, the alt text should be something like “Search”, not “magnifying glass”.

Code examples

Missing alt — fails WCAG 1.1.1

<img src="/images/team-photo.jpg">

Empty alt for a decorative image

<img src="/images/flourish.svg" alt="">

Meaningful alt for an informative image

<img src="/images/chart-sales-q1.png"
     alt="Sales grew 32% in Q1 2026, from €1.2M to €1.6M">

Redundant alt — avoid describing the image type

<!-- Avoid: the words "Image of" add no information -->

<img src="/rocket.png" alt="Image of a rocket taking off">

<!-- Prefer: -->

<img src="/rocket.png" alt="A rocket taking off">

Help us improve this glossary term

Was this guide helpful?

Scan your site

Rocket Validator scans thousands of pages in seconds, detecting accessibility and HTML issues across your entire site.

🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
$7 / 7 days

Pro Trial

Full Pro access. Cancel anytime.

Start Pro Trial →

Join teams across 40+ countries