Alt text — what does the law require and what makes good alt text?
Alt text is the image's stand-in for anyone who can't see it — screen readers read it aloud, and it appears when the image fails to load. The requirement is one of the oldest in WCAG and sits at the base level A, yet it remains one of the most common failures on the web. And it isn't just about the attribute existing: alt text that says "IMG_2031.jpg" is in practice as useless as none at all. Here we walk through what the law requires and what separates good alt text from bad.
What does the law say?
The base requirement is WCAG 1.1.1 at level A: non-text content must have a text alternative serving the same purpose. For images, that means the alt attribute. The criterion is part of the European standard EN 301 549, which both the Swedish Act on Accessibility to Digital Public Service (DOS-lagen) and the Swedish Accessibility Act (2023:254) point to.
Who is covered? The entire public sector through DOS-lagen, and since 28 June 2025 also private businesses covered by the EU's European Accessibility Act — e-commerce, banking services, passenger transport and electronic communications, among others. The core is services to consumers; pure B2B is not covered.
Three kinds of images — three kinds of alt text
- Informative images — describe what the image contributes in its context, not everything it depicts. The same photo may need different alt text on different pages, depending on why it's there.
- Decorative images — should have empty alt (alt=""), so screen readers skip them. An ornamental pattern or a pure mood shot adds nothing that needs reading aloud.
- Functional images — an image acting as a link or button is described by what it does or where it leads, not by what it looks like. The magnifying glass in a search button should be called "Search", not "magnifying glass".
Common issues we see
- File names as alt text — "IMG_2031.jpg", "hero-final-v2.png". The screen reader reads it out, character by character.
- Placeholders — "image", "photo", "logo" — announcing that something is there but not what it shows or does.
- Number sequences or id strings in the alt attribute, often from a CMS or image library that auto-fills it.
- Decorative images with chatty alt text — forcing screen reader users to sit through descriptions of pure decoration.
- Linked images where the alt text describes the picture instead of the link target — anyone tabbing to the link never learns where it leads.
How CompliantHQ tests this
The base scan — included in the trial as well — checks that images have alt attributes on every scanned page, as part of an automated sweep of some sixty rules against WCAG 2.0/2.1/2.2 at levels A and AA.
On paid plans we also review the quality: alt text consisting of file names, placeholders or number sequences is flagged, because it formally satisfies the attribute's presence but helps no one. The quality review is therefore not part of the trial — there, presence is what's checked.
How to fix it
- Go through your images page by page and ask: what does this image contribute here? The answer is the alt text — one sentence is usually enough.
- Set empty alt (alt="") on purely decorative images. It's a deliberate choice, not sloppiness — a missing attribute is an error, an empty one is a message to the screen reader.
- Describe destination, not appearance, for images that are links or buttons.
- Turn off or replace CMS features that auto-fill the alt text with the file name.
- Make alt text part of the editorial routine — the field should be filled in when the image is uploaded, not cleaned up afterwards.
What the check covers
- That alt texts carry meaning — file names, placeholders and digit strings used as alt text are flagged.
WCAG criteria covered
- 1.1.1 Non-text content — everything that isn't text (images, icons, buttons with symbols) must have a text description, so a screen-reader user knows what the image shows. (A)
Common questions
Does every image need alt text?
Every image needs an alt attribute — but decorative images should have it empty (alt=""), so screen readers skip them. The failures are the missing attribute and the meaningless content, not the empty string.
How long should alt text be?
As short as possible without losing the meaning — usually one sentence or less. If an image needs a long explanation, like a complex chart, that belongs in the body text instead.
What do I write for an image that is a link?
Where the link leads or what it does — "Go to homepage", not "company logo". Anyone tabbing to the link needs to know what a click will do.
Is alt text a legal requirement?
Yes, for those who are covered. WCAG 1.1.1 is part of EN 301 549, which DOS-lagen requires of the public sector and the Swedish Accessibility Act (2023:254) requires of covered private businesses since 28 June 2025.
Want to see what we find on your site?
Run a free scan — all four modules included for 30 days, no card required.