# SVG Img Alt

> SVG elements with an img, graphics-document, or graphics-symbol role must have an accessible name.

Source: https://knowledge.evinced.com/web/web-validations/svg-img-alt

SVG elements with an `img`, `graphics-document`, or `graphics-symbol` role must have an accessible name.

An SVG with an `img`, `graphics-document`, or `graphics-symbol` role represents meaningful visual information. Without an accessible name provided by `aria-label`, `aria-labelledby`, or a `<title>` element, assistive technologies cannot convey that meaning to people who cannot see the graphic. Adding a short, accurate text alternative ensures the graphic’s purpose is available to screen reader users.

## Pass Patterns

### Accessible name via `aria-label`

The `aria-label` gives the SVG a programmatically discernible text alternative that screen readers announce.

```html
<svg viewBox="0 0 65 65" aria-label="Circles" role="img">
    <ellipse rx="30" ry="30" transform="translate(32.5 32.5)" fill="none" stroke="#000" stroke-width="4"/>
    <ellipse rx="20" ry="20" transform="translate(32.5 32.5)" stroke-width="0"/>
</svg>
```

### Accessible name via `<title>` + `aria-labelledby`

The `<title>` element is referenced by `aria-labelledby`, so assistive technologies expose “Circles” as the element’s name.

```html
<svg viewBox="0 0 65 65" aria-labelledby="svg-logo-title" role="graphics-symbol">
    <title id="svg-logo-title">Circles</title>
    <ellipse rx="30" ry="30" transform="translate(32.5 32.5)" fill="none" stroke="#000" stroke-width="4"/>
    <ellipse rx="20" ry="20" transform="translate(32.5 32.5)" stroke-width="0"/>
</svg>
```

## Fail Patterns

### No text alternatives

Because the SVG lacks `aria-label`, `aria-labelledby`, or a `<title>`, it has no accessible name.

```html
<svg viewBox="0 0 65 65" role="graphics-symbol">
    <ellipse rx="30" ry="30" transform="translate(32.5 32.5)" fill="none" stroke="#000" stroke-width="4"/>
    <ellipse rx="20" ry="20" transform="translate(32.5 32.5)" stroke-width="0"/>
</svg>
```

### Empty `<title>` element

An empty `<title>` provides no useful information, so assistive technologies still announce nothing.

```html
<svg viewBox="0 0 65 65" role="img">
    <title></title>
    <ellipse rx="30" ry="30" transform="translate(32.5 32.5)" fill="none" stroke="#000" stroke-width="4"/>
    <ellipse rx="20" ry="20" transform="translate(32.5 32.5)" stroke-width="0"/>
</svg>
```

## WCAG techniques

### Sufficient techniques

-   [ARIA6: Using aria-label to provide labels for objects](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA6)
-   [ARIA10: Using aria-labelledby to provide a text alternative for non-text content](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA10)
-   [G92: Providing long description for non-text content that serves the same purpose and presents the same information](https://www.w3.org/WAI/WCAG22/Techniques/general/G92)
-   [G95: Providing short text alternatives that provide a brief description of the non-text content](https://www.w3.org/WAI/WCAG22/Techniques/general/G95)

### Failure techniques

-   [F38: Failure of Success Criterion 1.1.1 due to not marking up decorative images in HTML in a way that allows assistive technology to ignore them](https://www.w3.org/WAI/WCAG22/Techniques/failures/F38)
-   [F65: Failure of Success Criterion 1.1.1 due to omitting the alt attribute or text alternative on img elements, area elements, and input elements of type "image"](https://www.w3.org/WAI/WCAG22/Techniques/failures/F65)

## ACT Rules

-   [SVG element with explicit role has non-empty accessible name](https://www.w3.org/WAI/standards-guidelines/act/rules/7d6734/)
-   [Image has non-empty accessible name](https://www.w3.org/WAI/standards-guidelines/act/rules/23a2a8/)

## Try It Yourself

### Using a screen reader

**New to screen reader testing, or need a refresher?**  
Review this article first: [Practical guides for using screen readers](https://knowledge.evinced.com/a11y-essentials/practical-guides-for-using-screen-readers)

1.  Load the page and open a screen reader.
2.  Navigate to the graphic.
3.  Listen to the screen reader announce its name.

**Expected result:** You hear the text alternative (for example, “*Circles*”).

**Actual result:** If nothing is announced or the name is incorrect, the SVG fails.

### Inspecting the browser dev-tools

1.  Open the browser’s Accessibility pane.
2.  Select the SVG element.
3.  Verify that the Name property matches the intended alternative text.

**Expected result:** The Name field shows the descriptive text.

**Actual result:** A blank or missing name indicates failure.

## FAQ

**How does this issue relate to 1.1.1 Non-text Content?**

SC 1.1.1 requires every non-text element, including SVGs functioning as images, to expose an equivalent text alternative. Without it, users of assistive technologies cannot perceive the content at all.

**Why is this issue marked as Serious?**

When an SVG lacks alternative text, critical information becomes invisible to people who rely on screen readers or other assistive technologies. Because the barrier prevents basic understanding rather than merely lowering efficiency, the impact is high across browsers and platforms.

**What if the image is purely decorative?**

Use `role="presentation"` instead of `role="img"`, `role="graphics-document"` or `role="graphics-symbol"` (or use `aria-hidden="true"`) so assistive technology will ignore it.

## Standards and Regulations

| Standard | Success Criterion | Reference |
| --- | --- | --- |
| WCAG 2.2 | [1.1.1 Non-text Content](https://www.w3.org/TR/WCAG22/#non-text-content) (A) | All non-text content that is presented to the user has a text alternative that serves the equivalent purpose, except for controls/input, time-based media, tests, sensory experiences, CAPTCHA, and decoration/formatting/invisible content. |
| EN 301 549 | [9.1.1.1 Non-text Content](https://www.etsi.org/standards/etsi-301-549) | Same as the WCAG text. |
| Section 508 | [1194.22(a)](https://www.federalregister.gov/documents/2018/01/18/2018-00712/section-508-standards-update#d22) | A text equivalent for every non-text element shall be provided (e.g., via “\`alt\`”, “\`longdesc\`”, or in-element content). |
| 508 Trusted Tester | [1.1.1-meaningful-image-name, 7.A](https://section508coordinators.github.io/TrustedTester/images.html#check-111-meaningful-image-name) | The accessible name and accessible description for a meaningful image provides an equivalent description of the image. |
| 508 Trusted Tester | [1.1.1-decorative-image, 7.B](https://section508coordinators.github.io/TrustedTester/images.html#check-111-decorative-image) | There is no accessible name and accessible description for a decorative image. |

## Personas impacted by this issue

-   [Screen Reader](https://knowledge.evinced.com/a11y-essentials/personas#screen-reader)
-   [Braille](https://knowledge.evinced.com/a11y-essentials/personas#braille)

## Learn More

-   [Writing Effective Text Alternatives for Images](https://knowledge.evinced.com/a11y-essentials/writing-effective-text-alternatives-for-images)
-   [WAI-ARIA Graphics Module](https://www.w3.org/TR/graphics-aria-1.0/)

## Related Issues

-   [area-alt](https://knowledge.evinced.com/web/web-validations/area-alt)
-   [input-image-alt](https://knowledge.evinced.com/web/web-validations/input-image-alt)
-   [image-alt](https://knowledge.evinced.com/web/web-validations/image-alt)
-   [object-alt](https://knowledge.evinced.com/web/web-validations/object-alt)
-   [role-img-alt](https://knowledge.evinced.com/web/web-validations/role-img-alt)
