How to fix “<svg> elements with an img or image role must have alternative text”
By Justin Zagar · Updated
An SVG graphic is marked as an image (role="img") but has no text alternative. Give it an aria-label or a title element inside it, or, if it's decoration, remove the role and add aria-hidden="true".
- axe rule
svg-img-alt- WCAG
- 1.1.1 Non-text Content (Level A)
- Lighthouse
- Google Lighthouse and PageSpeed Insights report it as “SVG elements with an img role do not have an accessible text alternative”
What it means
Logos, icons and charts are often drawn as SVG code right in the page. Adding role="img" tells a screen reader to treat it as one picture, which is good, but then it needs a name the same way an img tag needs alt text.
Who it affects
People who use a screen reader.
How to find it
- Run the free checker. It lists the SVG's opening tag, which usually carries a class name that tells you what it is.
How to fix it
- If the SVG carries meaning (a logo, a chart, an icon with no text beside it), add aria-label, or a title element as its first child.
- If it's decoration, or there's text right next to it saying the same thing, take off role="img" and add aria-hidden="true" so it's skipped.
A logo drawn in SVG
<svg role="img" viewBox="0 0 120 40">...</svg><svg role="img" aria-label="Sample Marine" viewBox="0 0 120 40">...</svg>A decorative icon next to text
<svg role="img" class="icon-phone">...</svg> Call us<svg aria-hidden="true" class="icon-phone">...</svg> Call usWhat a scanner can and can’t tell you
Fixing this clears one automated check. It doesn’t mean the page is accessible, and it doesn’t settle any legal question. Automated tests catch only part of the problems. W3C puts it plainly: evaluation tools “can not determine accessibility, they can only assist in doing so.” The rest takes a person working through the site with a keyboard and a screen reader.
Source: W3C WAI, Selecting Web Accessibility Evaluation Tools. Not legal advice.
Sources
All checked November 8, 2026. The rule wording is axe-core 4.14.0’s own.
Related fixes
- Images must have alternative text
Images without alt text
- ARIA hidden element must not be focusable or contain focusable elements
Hidden content you can still tab to
- Links must have discernible text
Links with no text
Check a page for free
Scan any page of your site against WCAG 2.1 AA in about 30 seconds. You get the problems automated testing finds, in plain words, with a link to a fix guide for the common ones.
Rather have someone fix it for you? Tell me about your site.