
SVG Accessibility: Validate title, desc and Structure Without Breaking Optimization
Decorative vs informative icons: WCAG rules, title/desc tags and quick online validation.
Why SVG accessibility matters before optimization
An SVG optimized by 60 % is useless if a screen reader announces "image" with no context, or if a decorative icon clutters voice navigation. WCAG distinguishes decorative SVG (hidden from assistive tech) from informative SVG (title or description required). FastMinify's online SVG validator checks syntax, viewBox presence and missing <title> / <desc> — with advisory warnings, not a full WCAG audit. Everything runs in the browser on the online SVG tools hub, before or after optimize SVG. For SVGO preset context, see SVGO presets explained.
Concrete examples: UI icons and inline SVG
A "Delete" button with a trash SVG left of the text: SVG gets <code>aria-hidden="true"</code>, no title. validate-svg will show a title/desc warning — expected. Accessibility relies on button text, not the icon.
Before optimization
After optimization
A success or error badge shown only as SVG needs <code><title>Success</title></code> or an explicit <code>aria-label</code> on the component. validate-svg confirms text presence; then test keyboard and screen reader.
Best practices: WCAG, optimize and design systems
Add validate-svg to your asset review — especially for icons from designers without AT testing.
Aggressive preset may merge paths or strip IDs — rarely title/desc, but always compare visually. svg-to-jsx keeps markup; verify title/desc remain first children of <svg> in the React component.
FastMinify validate-svg is a structural safety net, not a substitute for a full page accessibility audit. Contrast, keyboard focus, tab order and long alternatives remain your responsibility or that of dedicated tools.
When the browser tool is enough
No need to install svgo-cli or a heavy a11y linter to check a Figma export before merge.
Complement with CI and AT audits
Automated page tests (Pa11y, axe-core in CI, Lighthouse accessibility) cover rendered DOM — not just the SVG source file. Keep validate-svg upstream on assets; add E2E tests with screen readers for critical flows.
Use the same SVGO preset in browser preview and CI. After pipeline optimize, sample icons and run validate-svg manually — see <a href="/en/blog/svgo-presets-optimize-svg-web" class="text-primary hover:underline">SVGO presets</a> and the <a href="/en/blog/svg-optimization-guide-web" class="text-primary hover:underline">SVG optimization guide</a>.
Complementary tools
FastMinify validate-svg targets SVG source markup. Other tools cover rendered pages or broader standards.
FastMinify validate-svg
XML syntax, viewBox, title/desc — browser, no account.
Pros:
Cons:
axe DevTools / WAVE
Browser extensions for DOM accessibility audit.
Pros:
Cons:
SVGO + manual validate
Classic CLI pipeline without validate-svg.
Pros:
Cons:
Decorative vs informative: the basics
An icon beside visible text ("Save", "Close") adds no extra information — it is purely visual. WCAG recommends hiding it from screen readers with <code>aria-hidden="true"</code> on <code><svg></code>, or an equivalent <code>role="presentation"</code>. In that case, <code><title></code> and <code><desc></code> are unnecessary — even counterproductive if they duplicate adjacent text.
A standalone pictogram (error status without text, inline chart, logo link without text alt) must convey meaning. Options: <code><title></code> and optionally <code><desc></code> as first children of <code><svg></code>, or <code>role="img"</code> + <code>aria-label</code> / <code>aria-labelledby</code> on the SVG element or its React wrapper.
The tool parses XML markup, requires an <code><svg></code> root, flags a missing <code>viewBox</code> (warning) and missing text in <code><title></code> or <code><desc></code> (warning). These are basic structural checks — not screen reader simulation, color contrast, or complex ARIA validation. For a full audit, pair with axe DevTools or WAVE alongside the browser validator.
FastMinify workflow: validate, fix, optimize
Open the validate SVG tool, paste markup or load a .svg file. Errors block delivery (invalid XML); warnings invite you to add viewBox or descriptive text depending on use case.
For an informative icon, add e.g. <title>Error</title> right after opening <svg>. If width/height exist without viewBox, derive one (viewBox="0 0 24 24") or use resize-svg on the hub. The SVG beautifier helps read structure after edits.
Once structure is validated, use the SVGO optimizer (safe or default preset for UI icons). FastMinify preserves <title> and <desc> on all three presets — run validate-svg again after optimize to confirm. The quick SVG minifier only touches whitespace and comments.
Conclusion
SVG accessibility starts with a clear decision: decorative (aria-hidden, no title) or informative (title/desc or aria-label). validate-svg helps secure syntax and structure before SVGO optimize — without claiming to replace a full audit. Chain validation, optimization and re-validation on the SVG hub to ship lightweight icons usable by everyone.
Related Articles

Convert SVG icons to React/JSX components, optimize with SVGO and ship them cleanly in your design system — browser-local tools.

Safe, default or aggressive? Pick the right SVGO preset, optimize SVG for production and avoid visual regressions in the browser.

Check `compose.yml` and `.env` structure before `docker compose up` — validate locally in your browser without installing CLI tools.