Accessible SVG: Text Alternatives for Icons, Logos
Also called: Accessible SVG icons, SVG alt text, Inline SVG accessibility
Definition
Accessible SVG means scalable vector graphics that assistive technology can handle correctly: an SVG that carries meaning gets role="img" and a text alternative, a decorative SVG is hidden with aria-hidden="true", and an icon inside a link or button leaves the name to its control. SVGs are non-text content under WCAG 1.1.1 at Level A.
Accessible SVG is about giving vector graphics the same treatment as images: a text alternative when they mean something, silence when they don't. Logos, icons, illustrations and simple charts are often inline SVG, and without extra markup screen readers either skip them, read out "image" with no name, or announce a jumble of path data. A few attributes make the difference.
What it means
Every SVG is non-text content under WCAG 1.1.1 Non-text Content (Level A): "All non-text content that is presented to the user has a text alternative that serves the equivalent purpose." The exceptions matter for SVG too – controls need a name that describes their purpose, and decoration must be implemented so assistive technology can ignore it. W3C's test rules check that an SVG element with an explicit role has a non-empty accessible name.
In practice there are four cases:
| SVG is … | What to do | W3C technique |
|---|---|---|
| A meaningful graphic or logo | role="img" plus aria-label or aria-labelledby pointing to its <title> |
ARIA6, ARIA10 |
| Decorative (flourish, background shape) | aria-hidden="true" and no role |
Decoration exception |
| An icon inside a link or button | Hide the SVG, give the control a name | Controls exception, see 4.1.2 |
| A chart or diagram | Short name plus a longer description or data table | G95, ARIA15, G74 |
An <img src="logo.svg"> works like any other image and takes an alt attribute – see alt text. The tricky part is inline <svg>, because browsers don't treat it as an image by default.
Examples
<!-- Meaningful graphic -->
<svg role="img" aria-labelledby="award-title" viewBox="0 0 64 64">
<title id="award-title">Winner of the 2026 Design Award</title>
<path d="…" />
</svg>
<!-- Decorative wave -->
<svg aria-hidden="true" focusable="false" viewBox="0 0 400 40">
<path d="…" />
</svg>
<!-- Icon in a button: the button carries the name -->
<button type="button" aria-label="Search">
<svg aria-hidden="true" focusable="false" viewBox="0 0 24 24"><path d="…" /></svg>
</button>The award badge is announced as an image with its name. The wave is invisible to screen readers, just like other decorative images. In the search button, the SVG stays silent and the aria-label becomes the button's accessible name – without it, you would have an icon button that says nothing. focusable="false" keeps older browsers from putting the SVG in the tab order.
Decide for each SVG whether it carries meaning, add role="img" and a short name to meaningful ones, hide decorative ones with aria-hidden="true", name the control rather than the icon, and make sure icon colors also meet non-text contrast.
Rely on a <title> alone, put aria-label on an SVG that has no role, give an icon and its button two different names, leave decorative SVGs exposed, or use an SVG of text instead of real text.
How to check accessible SVG
Questions
How do I add alt text to an SVG?
For <img src="file.svg">, use the alt attribute as with any image. For inline <svg>, add role="img" and either aria-label="…" or aria-labelledby pointing to a <title> inside the SVG.
Should SVG icons have aria-hidden?
Yes, when the icon sits next to visible text or inside a link or button that already has a name. Then the icon is hidden with aria-hidden="true" and the control carries the name. A standalone icon that conveys information needs its own name instead.
Does an SVG logo need alt text?
Yes, a logo carries meaning – usually the company name. If the logo is also the link to the home page, name the link, for example "Acme Bakery – home", and hide the SVG inside it.
How do I make an SVG chart accessible?
Give it a short name with role="img" and provide the full information in text – a description next to it or a data table. W3C calls this a short plus a long text alternative.
What does focusable="false" do on an SVG?
It stops some older browsers from putting the SVG into the tab order. Modern browsers don't need it, but it does no harm on decorative SVGs and icons.
Related terms
Alt text
Alt text is a short written description of an image. Screen readers read it aloud, and browsers show it when the image can't load – so people who can't see the image still get its meaning.
Read definition: Alt textDecorative Images: When alt="" Is the Right Choice
Decorative images are images that are pure decoration or only used for visual formatting and add no information to the page. WCAG 1.1.1 requires that they are implemented in a way that assistive technology can ignore, for example with an empty alt attribute or as a CSS background.
Read definition: Decorative Images: When alt="" Is the Right ChoiceIcon Button: How to Give It an Accessible Name
An icon button is a button that shows only a symbol – a magnifier, a cross, three lines – and no visible text. To be accessible it needs an accessible name in code that tells assistive technology what the button does.
Read definition: Icon Button: How to Give It an Accessible NameAccessible Name: What It Is and How It Is Computed
The accessible name is the text that browsers pass to assistive technology to identify an element – for example the words a screen reader announces for a button, link or form field. WCAG 4.1.2 requires a programmatically determinable name for every user interface component.
Read definition: Accessible Name: What It Is and How It Is Computed