SVG Validator
Catch SVG errors and spec violations before they reach production.
SVG validation
Validate SVG markup, structure and common issues.
Paste SVG markup, upload a file or try the built-in sample, then validate it. The tool checks XML parsing, the root <svg> element, xmlns, viewBox and dimensions, duplicate IDs and broken references, quick accessibility signals and safety flags — then lists issues by severity. It is a practical browser-side checker, not a full replacement for the official W3C validator. It never modifies your SVG. Everything runs locally; your file is not uploaded.
Please check the SVG markup and try again.
SVG preview
Paste SVG markup or try the sample, then click Validate SVG.
SVG markup
Paste a complete SVG document or inline SVG element, then click Validate SVG. The markup is never changed.
Validation overview
Issues
XML & parsing
Root SVG
Dimensions
Reference checks
Accessibility quick checks
Safety signals
How It Works
SVG Validator checks SVG markup for common structural and syntax problems entirely in your browser. Paste SVG markup, upload an .svg file or try the built-in sample, then click Validate SVG. The tool first parses the markup as XML and reports any parse errors, then confirms the root element is <svg> and inspects key root attributes — xmlns, viewBox, width/height and accessibility metadata. It validates that the viewBox has four numeric values with positive width and height, flags negative, zero or percentage dimensions, and runs practical element and attribute checks (empty path data, use/image without href, resource elements missing an id, unknown elements). It also performs basic cross-checks for duplicate IDs and broken url(#id), href and ARIA references, quick accessibility signals and safety flags. Every finding is listed by severity (error, warning, info). SVG Validator is a practical browser-side checker, not a full replacement for the official W3C validator. SVGTrim validates SVG markup locally in your browser; your SVG file is not uploaded, and the tool does not modify the original markup.
Use Cases
- Quickly catching XML syntax errors and malformed SVG before using a file in production
- Confirming an SVG has a valid viewBox and sensible width/height for predictable scaling
- Spotting duplicate IDs and broken url(#id) / href references that break gradients, masks and clip paths
- Running a fast accessibility and safety sanity check (missing title, scripts, event handlers, foreignObject)
- Reviewing exported SVGs from design tools for missing xmlns, empty paths or unknown elements
FAQ
What is an SVG validator?
It is a tool that checks SVG markup for problems — invalid XML, a missing or wrong root element, a malformed viewBox, bad dimensions, duplicate IDs, broken references and basic accessibility or safety issues. This validator runs those checks in your browser and lists the findings by severity.
Does this tool replace the official W3C validator?
No. SVG Validator is a practical browser-side checker that focuses on the issues that commonly break SVGs in real browsers. It is not a full conformance checker and is not a replacement for the official W3C validator. Use it for fast, everyday validation.
Does it check viewBox errors?
Yes. It confirms the viewBox is present, has exactly four numeric values, and that the width and height are greater than zero. It also flags negative or zero width/height attributes and reports percentage dimensions for review.
Are broken id references checked?
Yes, at a basic level. It detects duplicate IDs and broken references from url(#id), href / xlink:href and aria-labelledby / aria-describedby that point to IDs which do not exist. For a deeper reference audit, use the dedicated SVG ID Reference Checker.
Is my SVG file sent to an external service?
No. SVGTrim validates SVG markup locally in your browser. Your SVG file is not uploaded, and the tool does not modify the original markup. There is no API call, no AI involved and no external service involved in the validation.