SVG READYFIELD GUIDE
Русский Open the free checker

A practical field guide

SVG alt text: examples that say the right thing

The right label depends on what the graphic does on this page. A meaningful illustration needs a useful name. A decorative flourish needs to stay quiet. An icon inside a labeled button usually needs no separate announcement.

Use these patterns as starting points, then check them in the context of the page. The free SVG Ready checker flags common markup issues and creates copy-ready HTML or React snippets; it cannot decide what your graphic means or replace a full accessibility review.

1. An SVG image in an <img> element

For an informative external SVG, put its concise text alternative in the HTML alt attribute. Describe the information or action the graphic contributes, rather than its colors or the fact that it is an image.

<img src="payment-success.svg" alt="Payment received">

If the graphic adds no information beyond nearby text, use an empty alt value so assistive technology can skip it.

<img src="sparkle-divider.svg" alt="">

2. A meaningful inline SVG

When an inline SVG is a single meaningful graphic, give the SVG an image role and connect it to a short title. The title is text in the markup, so keep it concise and specific.

<svg role="img" aria-labelledby="chart-title" viewBox="0 0 240 120">
  <title id="chart-title">Monthly sign-ups rose from 18 to 42</title>
  <!-- graphic paths -->
</svg>

If the same information is already presented in a nearby table or paragraph, avoid repeating a second long description as the graphic's name. For a complex chart, provide the useful values and relationships as real page text as well.

3. A decorative inline SVG

Hide an inline SVG from the accessibility tree when it is purely decorative and contains no focusable or interactive content.

<svg aria-hidden="true" viewBox="0 0 24 24">
  <path d="…"></path>
</svg>
Quick decision: if removing the graphic would remove information or make an action unclear, it is not merely decorative. If nearby text already gives its information and it does not change the control's purpose, keep the graphic silent.

4. An icon inside a button or link

Name the control itself. If visible text already explains the action, hide the icon from assistive technology to prevent a second, redundant announcement.

<button type="button">
  <svg aria-hidden="true" viewBox="0 0 24 24">…</svg>
  Save changes
</button>

When an icon is the only content in a control, give the button or link an accessible name such as aria-label="Close dialog". The name should describe the action, not just the shape of the icon.

5. A quick review before shipping

Check an SVG in your browser →

References

← Back to SVG Ready