SVG images must have alternative text
An inline `<svg>` marked as an image, with `role="img"` or a graphics role, needs a text alternative, so screen reader users get the information the graphic shows.
| Rule ID | svg-img-alt |
|---|---|
| Impact | Serious |
| Success criterion | 1.1.1 Non-text Content · A |
| Standards | WCAG 2.0 · WCAG 2.1 · WCAG 2.2 · Section 508 · EN 301 549 |
| Fixed with a text: from the page or written by AI |
Example
<svg role="img" viewBox="0 0 24 24" width="24" height="24">
<path d="M12 2 2 22h20z"></path>
</svg>
<span>Low stock</span>A screen reader announces “image, Low stock”, and the warning meaning is lost.
<svg role="img" viewBox="0 0 24 24" width="24" height="24">
<title>Warning</title>
<path d="M12 2 2 22h20z"></path>
</svg>
<span>Low stock</span>A screen reader announces “Warning, image, Low stock”.
Why it matters
Inline SVG is used for logos, icons, charts and illustrations. Once you add role="img", screen readers treat the SVG as one picture and stop reading its inner parts. If you do not give it a name, blind users hear only “image” or nothing, and miss what it conveys: a company logo, a warning sign, the trend in a chart.
SVG has no alt attribute, so developers often forget it needs a text alternative at all. Browser support for the SVG <title> element also varies between screen readers, which is why adding an ARIA name as well is a common safeguard.
How to fix it
Give the SVG a name that says what it means.
Use a <title> as the first child. It also shows as a tooltip in some browsers:
<svg role="img" viewBox="0 0 120 40">
<title>Oakline Furniture</title>
...
</svg>
Use aria-label for short names, or aria-labelledby to point at the <title> or at visible text. Pointing at the <title> gives the most consistent support:
<svg role="img" aria-labelledby="chart-title" viewBox="0 0 400 200">
<title id="chart-title">Orders per month, rising from 120 in January to 310 in June</title>
...
</svg>
Complex charts. Keep the name short and put the full data in a table or text next to the chart.
Decorative or redundant SVG. If the icon sits next to a text label that says the same thing, hide it instead of naming it:
<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24">...</svg>
Do not leave role="img" on an SVG you meant to hide.
Checklist
- Add a title element or aria-label to every SVG with role="img".
- Point aria-labelledby at the title for consistent support.
- Describe meaning, not shapes or colours.
- Hide decorative SVG icons with aria-hidden="true".
How the check works
The check looks at SVG elements with role="img", role="image", role="graphics-symbol", or an <svg> with role="graphics-document". It passes when the element has a direct <title> child with text, an aria-label, an aria-labelledby that points to text, or a non-empty title attribute. Otherwise it is reported. Whether the text is accurate needs a human check.
Resources
- Understanding 1.1.1 Non-text Content W3C
- W3C ACT rule 7d6734 W3C ACT
- Images tutorial W3C WAI
- Providing accessible names and descriptions W3C WAI
Updated October 27, 2026