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
<img src="team-photo.jpg"> <img src="logo.png">
<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 ValidatorHostinger — Fast & Affordable Web Hosting
Deploy clean, validated HTML on reliable hosting.
Related HTML Errors
Empty Heading Tags
Why empty h1, h2, h3 headings hurt SEO and accessibility. How to fix or remove empty heading elements.
Missing Lang Attribute
Learn why the lang attribute on the html element is critical for screen readers, translations, and SEO.
Missing Viewport Meta Tag
Why the viewport meta tag is essential for responsive design. Fix mobile rendering issues with the correct viewport configuration.