Skip to main content
Beta: Front-End Checklist is currently in beta. Some issues are still being fixed. Thanks for your patience.
ImagesCritical

Provide meaningful alt text for images

Every informative image has a descriptive alt attribute; decorative images use alt="" to be ignored by screen readers.

Utilities
Quick take
Typical fix time 15 min
  • Every `<img>` must have an `alt` attribute—omitting it entirely violates WCAG 2.1 SC 1.1.1
  • Decorative images use `alt=""` so screen readers ignore them
  • Alt text should describe the image's *purpose*, not just its appearance
  • Linked images: alt describes the link destination, not the visual
Why it matters: Approximately 2.2 billion people worldwide have vision impairment. Screen readers read the alt attribute aloud—without meaningful alt text, users who are blind receive no information about image content. Missing alt text also fails WCAG 2.1 Success Criterion 1.1.1, which is a Level A (minimum) requirement. Search engines also rely on alt text to index image content.

Rule Details

The alt attribute is the primary accessibility mechanism for images. Every <img> must have an alt attribute. Its value depends on the image's role.

Good to Know

Use the W3C alt decision tree (opens in new tab) to determine the correct alt value for any image type.

Code Example

Images that convey meaning need descriptive alt text explaining what the image communicates.

<!-- ❌ Bad: Missing alt -->
<img src="revenue-chart.png">
 
<!-- ❌ Bad: Filename as alt -->
<img src="revenue-chart.png" alt="revenue-chart.png">
 
<!-- ❌ Bad: Generic alt -->
<img src="revenue-chart.png" alt="chart">
 
<!-- ✅ Good: Describes what the image conveys -->
<img
  src="revenue-chart.png"
  alt="Bar chart showing Q3 2024 revenue increased 40% year-over-year, reaching $2.4M"
>

Why It Matters

Approximately 2.2 billion people worldwide have vision impairment. Screen readers read the alt attribute aloud—without meaningful alt text, users who are blind receive no information about image content. Missing alt text also fails WCAG 2.1 Success Criterion 1.1.1, which is a Level A (minimum) requirement. Search engines also rely on alt text to index image content.

Decorative Images

Images used purely for visual decoration carry no information and should be hidden from assistive technology.

<!-- ❌ Bad: No alt attribute—screen reader may announce the filename -->
<img src="decorative-swirl.png">
 
<!-- ✅ Good: Empty alt hides image from screen readers -->
<img src="decorative-swirl.png" alt="">
 
<!-- ✅ Good: Or use CSS background images for decoration -->
<div class="decorative-swirl" aria-hidden="true"></div>

When an <img> is inside an <a>, the alt text must describe the link destination, not the visual appearance.

<!-- ❌ Bad: Describes appearance, not destination -->
<a href="https://twitter.com/example">
  <img src="twitter-logo.svg" alt="Blue bird logo">
</a>
 
<!-- ✅ Good: Describes the link destination -->
<a href="https://twitter.com/example">
  <img src="twitter-logo.svg" alt="Follow us on Twitter">
</a>

Images of Text

If an image contains text (e.g., a logo, banner, or screenshot), reproduce that text verbatim in alt.

<!-- ✅ Good: Alt reproduces the text shown in the image -->
<img src="sale-banner.png" alt="Summer Sale — 50% off all items">
 
<!-- ✅ Good: Logo with company name -->
<img src="logo.svg" alt="Acme Corp">

Complex Images (Charts, Diagrams)

For complex visuals, provide a brief alt plus a longer description accessible to all users.

<!-- Using aria-describedby to link to a visible description -->
<figure>
  <img
    src="org-chart.png"
    alt="Company organisational chart"
    aria-describedby="org-chart-desc"
  >
  <figcaption id="org-chart-desc">
    The chart shows three departments reporting to the CEO: Engineering (12 staff),
    Marketing (8 staff), and Operations (5 staff).
  </figcaption>
</figure>

Framework Examples

interface ImageProps {
  src: string
  alt: string
  decorative?: boolean
}
 
function AccessibleImage({ src, alt, decorative = false }: ImageProps) {
  return (
    <img
      src={src}
      // Decorative images use empty string; informative images use descriptive text
      alt={decorative ? '' : alt}
    />
  )
}
 
// Usage
<AccessibleImage src="hero.jpg" alt="Team members collaborating in a modern office" />
<AccessibleImage src="divider.png" decorative />

Standards

  • Use these references as the standard for the final image format, delivery, accessibility, and rendering behavior.
  • Check the implementation against MDN: Responsive images before treating the rule as satisfied.
  • Check the implementation against web.dev: Image performance before treating the rule as satisfied.

Verification

Automated Checks

  • Run axe DevTools or WAVE on the page—both flag missing or empty non-decorative alt attributes
  • Use Lighthouse Accessibility audit—"Images do not have alternate text" is a scored item

Manual Checks

  • Enable a screen reader (VoiceOver, NVDA, or JAWS) and navigate through images with the G key
  • Inspect the Network tab: for any image URL, verify the corresponding <img> has a meaningful alt
  • CAPTCHA images — provide alt describing the purpose, not the characters (e.g., alt="CAPTCHA: type the characters shown"), and offer an audio alternative per WCAG 1.1.1
  • SVG icons with adjacent text labels — if the icon's meaning is already conveyed by visible text, use aria-hidden="true" on the SVG instead of alt

Use with AI

Copy these prompts to use with your AI assistant, or install the MCP server to use directly from Claude, Cursor, or Windsurf.

Check

Verify implementation

Scan all <img> elements in the codebase. Verify: 1) Every <img> has an alt attribute (missing alt is an error). 2) Decorative images use alt="". 3) Informative images have descriptive text that conveys the image's meaning—not just its file name. 4) Images that are links describe the destination. 5) Images of text reproduce the text in alt. Flag any <img> without alt, with alt matching the filename (e.g., alt="photo1.jpg"), or with generic values like alt="image" or alt="photo".

Fix

Auto-fix issues

For each image missing or with poor alt text: 1) Informative images—describe what the image conveys, not just what it shows (e.g., alt="Bar chart showing 40% increase in sales Q3 2024" not alt="chart"). 2) Decorative images—add alt="" so screen readers skip them. 3) Linked images—describe the link destination (e.g., alt="Visit our Twitter profile"). 4) Images of text—copy the text verbatim into alt. 5) Complex images (charts, infographics)—provide a short alt plus a longer description via aria-describedby or a visible caption.

Explain

Learn more

Explain WCAG 2.1 Success Criterion 1.1.1 Non-text Content: every image must have a text alternative. Screen readers announce the alt attribute aloud—without it, users who are blind or have low vision cannot understand the page. Bad alt text (like alt="image") is no better than no alt text. Decorative images must use alt="" explicitly so screen readers skip them entirely—omitting alt causes some screen readers to announce the filename.

Review

Code review

Review image assets, markup, and delivery configuration related to Provide meaningful alt text for images. Flag exact files or components where format choice, sizing, or loading behavior violates the rule, and describe how to confirm the fix in DevTools.

Sources

References used to support the guidance in this rule.

Further Reading

Tools and supplementary material for exploring the topic in more depth.

alt attribute — MDN Web Docs

by MDN

developer.mozilla.orgDocs
axe DevToolsdeque.comTool
Lighthouse Accessibility Auditdeveloper.chrome.comTool

Rules that often go hand-in-hand with this one.

Use <figure> and <figcaption> for image captions

Images with visible captions are wrapped in <figure> with a <figcaption> child, creating a semantic association between image and caption.

Images
Handle image loading errors gracefully

Broken images are handled gracefully with fallback images or placeholder content.

Images
Set explicit width and height on images

All <img> elements have explicit width and height attributes so browsers can reserve space before the image loads, preventing layout shift.

Images

Was this rule helpful?

Your feedback helps improve rule quality. This stays internal for now.

Loading feedback...
0 / 385