SVG Validator for Syntax and Basic Accessibility
An SVG validator parses pasted markup as XML, reports the first structural error it finds, and then checks the outer svg element for a viewBox and for the title and desc elements a screen reader reads.
The markup is parsed as XML in a separate document. It is never inserted into this page, never rendered and never run. Advisory checks only. Up to 1,000,000 characters, and a loaded file is read as text after the 2 MB file limit.
Files and pasted text are read in this page; nothing is uploaded and no account is needed. This page also loads analytics scripts, so avoid confidential text. The markup you paste is parsed in a separate document and is never inserted into this page, so nothing in it runs or loads.
This checks one file. It is not a WCAG audit and cannot certify conformance. A file can pass here and still be unusable for a reader.
Result
Next: reformat XML markup, which does not tell you whether a root element is svg, or check a colour pair contrast, which is not one of the checks here.
Why check SVG markup before you ship it?
Broken XML fails silently
An SVG with an unclosed tag often looks fine in an editor that renders what it can, then disappears in a browser or an email client. Parsing as XML reports the failure with a position instead of leaving a blank box.
viewBox decides scaling
Without a viewBox the drawing keeps its pixel size and either overflows or shrinks into a corner. The warning names the attribute and the numbers found, so the fix is a specific edit.
A name a screen reader can read
A title element gives the graphic an accessible name. The check reports whether one exists and where it sits, and leaves the wording to you, because only you know what the drawing shows.
How the SVG check works
The markup is parsed as XML in a separate document that is never attached to this page. A parser error comes back as a node, so the report can name the problem without the browser trying to render anything. Once the document is well formed, the check looks at the root element: it must be svg, in the SVG namespace, and its viewBox attribute, when present, must hold four finite numbers with a positive width and height.
The accessibility part is deliberately narrow. A title as the first child of the root becomes the accessible name of the graphic, and a desc next to it carries a longer description. Browsers do not draw either element, and some show the title as a tooltip, which is why an icon that only says icon passes the structural check and still fails the reader. The report counts what it found and says nothing about whether the wording is any good.
Errors, warnings and what is out of scope
- ErrorsNot well formed XML, a root that is not svg, a root in another namespace, an empty document, or markup past the size cap. Each error stops the structural checks, because nothing below a broken root is meaningful.
- viewBox warningReported when the root has no viewBox, or when its four values are not finite numbers or have a zero or negative width or height. The attribute is reported as written.
- Title and descThe report says whether a title is the first child of the root, whether it is empty, and whether a desc exists. Wording, language and whether the text describes the drawing are yours to judge.
- Scripts and handlersEvery element and every attribute is walked, so a script element or an on attribute is reported wherever it sits, including on the root svg, a marker, a filter or an animation, and it is never executed, because the parsed document is not attached to this page and has no browsing context. External references are counted when they are absolute or protocol relative, and a stylesheet instruction outside the root element counts when a browser would load it as css, including one that names no type.
- DOCTYPE entitiesA document type declaration with an internal entity is reported as a warning and the entity is not expanded, which avoids entity expansion attacks.
- Out of scopeNo rendering, no colour or contrast check, no optimise, no sanitise, no conformance claim. A file can pass every check here and still be unusable for a reader.
Common Use Cases
Gate a design handoff
Check icons from a design export before they reach a component library, so an unclosed tag or a missing viewBox is caught at the source.
Debug an invisible icon
Find out whether a graphic that renders nothing is malformed XML, in the wrong namespace, or simply sized to nothing.
Review a shared file
Read what a downloaded SVG actually contains before you open it, including any script element or event handler the sender left in.
How to validate SVG markup
Paste the markup
Paste the SVG source or open a saved .svg file. The file is read as text, never as an image.
Run the check
The markup is parsed as XML and the verdict reports the first structural error with its position.
Read the structure
The report names the root, the namespace, the viewBox values and whether a title and desc were found.
Fix and repeat
Edit the source by hand and validate again, then copy the report if you need to share what failed.
A parse, not a preview
Nothing runs
Scripts and event handlers are reported and never executed, because the pasted document is never attached to this page.
Specific messages
A warning names the attribute or element it concerns, so the next edit is obvious instead of a guess about which part broke.
Honest scope
The report says it checks one file and cannot certify conformance, so a passing file is not mistaken for an accessible page.
What a passing check does not cover
- •Name the drawing: Write a title that says what the graphic shows. A title of icon or logo satisfies the structure and tells a reader nothing.
- •Decorative means hidden: A purely decorative graphic should be hidden from assistive technology in the page that embeds it, which is outside this file check.
- •Test the page too: Contrast, focus order and the surrounding text belong to the page. Use a page-level checker as well when accessibility matters.
Check SVG markup now
Paste the SVG source above and read the verdict with the structure it found.
Fix the error or warning in your own editor, validate again, and copy the report when you need to pass it on.
Related tools
Frequently Asked Questions
Is this a WCAG audit?
No. It parses one SVG file and reports structural problems plus advisory warnings about viewBox, title and desc. Conformance depends on the page, the surrounding content and a manual review.
Does the tool run scripts in the SVG?
No. The markup is parsed in a separate document that is never attached to this page, so a script element or an event handler is reported and never executed.
What is the difference between an error and a warning?
An error means the markup cannot be read as an SVG, such as broken XML or a root that is not svg. A warning means the file is readable but something is missing or suspicious, such as no viewBox or no title.
Why report a missing title when the graphic still displays?
A title becomes the accessible name a screen reader announces. Without one the graphic can be read as an unlabelled image, which is a content problem rather than a rendering problem.
Can I fix the file here?
The report names what failed and leaves the edit to you. Nothing is rewritten, sanitised or optimised, so you always know which bytes you are shipping.