Lighthouse audit image-alt · Accessibility

Image elements do not have [alt] attributes: how to fix it

View raw .md for LLMs / your notes

Every meaningful <img> needs an alt attribute. Screen readers announce alt text; without it, blind users get "image" or the URL filename. This audit also affects SEO, Google uses alt text to understand image content for image search and image-related rankings.

TL;DR

What the audit checks

Lighthouse fails the audit when any <img> element lacks an alt attribute. Note: an empty alt="" is valid, it marks an image as decorative and tells screen readers to skip it. Missing entirely is the failure.

Why it matters

Accessibility

Screen readers handle <img> based on the alt attribute:

SEO

Google Images is the second-largest search engine. Alt text is one of the strongest signals for image search ranking and a useful signal for the overall page topic.

Graceful degradation

When images fail to load (network errors, blocked by content blockers, slow connections), the browser displays the alt text in the image's place. Without it, users see a broken icon.

The fix

Content images: describe what's in the image

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

<!-- RIGHT -->
<img src="/team-photo.jpg"
     alt="Eight engineers gathered around a whiteboard discussing system architecture" />

Decorative images: use empty alt

If an image adds no information (background patterns, decorative dividers, icons paired with adjacent text), use alt="":

<button>
  <img src="/icons/chevron.svg" alt="" />
  Continue
</button>

The "Continue" text already conveys the meaning. The chevron is decorative.

Images that are links: describe the link destination

<!-- WRONG: vague -->
<a href="/account">
  <img src="/avatar.jpg" alt="Avatar" />
</a>

<!-- RIGHT: alt describes where the link goes -->
<a href="/account">
  <img src="/avatar.jpg" alt="Your account settings" />
</a>

Images with text in them

If an image contains text (a quote graphic, an infographic header), include the text in the alt:

<img src="/quote-card.png"
     alt="Quote from Jane Doe: 'This tool saved us 12 hours per week.'" />

For complex infographics, use alt for the short version and provide a longer text description nearby or via aria-describedby.

Common mistakes

Writing good alt text

Ask yourself: if this image disappeared and was replaced with text, what text would convey the same information?

Framework patterns

React / Next.js

<Image src="/hero.jpg" alt="..." width={1200} height={800} />

ESLint rule jsx-a11y/alt-text will catch missing alts in CI.

Vue

Use the official eslint-plugin-vuejs-accessibility package.

WordPress

Set the alt attribute in the Media Library when uploading, it carries through automatically.

Verification

  1. Re-run Lighthouse, image-alt audit should pass.
  2. Use the axe DevTools extension for a deeper check.
  3. Test with VoiceOver or NVDA on a few representative pages.
  4. Disable images in your browser (or DevTools → Network → block image requests) to see how the page degrades.

Related audits


Audit your URL at https://lighthouse-md.com.

Audit your page now

Paste your URL, get scores plus a CLAUDE.md plan for Claude Code.

Run audit →