</>
ValidateHTML

Missing Alt Attribute on Images

The alt attribute provides alternative text for an image. Screen readers announce this text to visually impaired users. Search engines use it to understand image content. When an image fails to load, the alt text is displayed instead.

Why It Matters

Missing alt text is the #1 accessibility violation on the web. It's also a missed SEO opportunity — Google Image Search uses alt text to index images. WCAG 2.1 Level A requires alt text on all meaningful images.

Code Examples

❌ Invalid
<img src="team-photo.jpg">
<img src="logo.png">
✓ Valid
<img src="team-photo.jpg" alt="Our engineering team at the 2026 offsite">
<img src="logo.png" alt="ValidateHTML logo">

How to Fix

  • 1Add descriptive alt text that explains what the image shows, not what it is ("team celebrating" not "image").
  • 2For decorative images (borders, spacers), use an empty alt: alt="".
  • 3Keep alt text under 125 characters — screen readers may truncate longer text.
  • 4Don't start with "Image of" or "Picture of" — screen readers already announce it as an image.

Check Your HTML Now

Our validator detects this error automatically and shows the exact line number.

Open HTML Validator
Recommended

Hostinger Fast & Affordable Web Hosting

Deploy clean, validated HTML on reliable hosting.

Get 80% Off Hosting →

Related HTML Errors

← View all HTML errors