Alt Text
Alt text, short for alternative text, is a brief written description of an image on a web page. It’s added to the HTML using the alt
attribute and is used to describe the content or function of the image for both accessibility and SEO purposes.
If an image fails to load, the alt text appears in its place. But more importantly, it’s read aloud by screen readers for users who are visually impaired, allowing them to understand the image’s context.
Why alt text is important
Alt text serves two main functions:
- Accessibility
It helps people who use screen readers navigate the web. Alt text ensures your content is usable by everyone, including users with visual impairments. This makes your website more inclusive and compliant with accessibility standards like WCAG (Web Content Accessibility Guidelines) and ADA (Americans with Disabilities Act). - Search Engine Optimization (SEO)
Search engines can't "see" images the way humans do. Alt text provides them with a textual description, helping search engines understand what the image is about. This can improve your chances of appearing in image search results and boost overall page relevance.
What good alt text looks like
Effective alt text is:
- Descriptive but concise – Explain what’s in the image, but keep it short (typically under 125 characters).
- Contextual – Describe the image in a way that matches its purpose on the page.
- Not stuffed with keywords – Use relevant terms naturally, without forcing SEO keywords.
- Not redundant – Avoid repeating surrounding text or phrases like "Image of" or "Picture of."
When to use (and not use) alt text
Use alt text for meaningful images: Like product photos, infographics, or illustrations that add value to the page.
Skip it or use empty alt text (alt="") for decorative images: If an image is purely decorative and doesn’t add context, screen readers should ignore it.
Alt text vs. title text
Don’t confuse alt text with the image title attribute. The title may show a tooltip when a user hovers over an image, but it doesn’t improve accessibility or SEO in the same way.
In summary, alt text is a small but powerful part of your website’s HTML. It boosts accessibility for visually impaired users and helps search engines understand your images. Writing helpful, relevant alt text improves both user experience and SEO — making it a must-have on every page.