XML Validator
This XML validator checks that a document is well-formed: every element closed in the right order, attributes quoted, no stray angle brackets, exactly one root. When something is wrong you get the line and column of the first problem rather than a generic failure message, so you can go straight to it. Note that well-formedness and validity are different questions — this checks syntax, not conformance to a DTD or XSD, which describe which elements are allowed where. Validation runs entirely in your browser.
How it works
Checks that the document is well-formed: every element closed in the right order, attributes quoted, no stray angle brackets. When something is wrong you get the line and column of the first problem rather than a generic failure.
This is a well-formedness check, not a schema check — it does not validate against a DTD or XSD, which describe which elements are allowed where.
Everything runs in your browser — nothing you paste is sent to a server.
How to validate XML
- Paste your XML into the editor.
- A green banner confirms the document is well-formed.
- If it is not, the first error is reported with its line and column.
Well-formed is not the same as valid
There are two separate questions you can ask about an XML document. Well-formedness is about syntax: is every element closed, in the right order, with quoted attributes and no stray angle brackets? That is what this tool checks. Validity is about a schema: does this document use the elements a particular DTD or XSD allows, in the order it requires? That needs the schema itself, and is not checked here.
The errors that come up most
- A closing tag that does not match the nearest open one, usually from a bad copy and paste.
- An unescaped
&or<inside text — both must be written as entities. - An unquoted attribute value, which XML forbids even though HTML tolerates it.
- More than one root element, which XML allows exactly one of.
Frequently asked questions
What does this XML validator check?
It checks well-formedness — that every element is closed in the right order, attribute values are quoted, special characters are escaped, and the document has exactly one root element.
Does it validate against a DTD or XSD?
No. That is a different question: a schema describes which elements are allowed where, and checking it requires the schema itself. This tool answers whether the document is syntactically valid XML at all.
What are the most common XML errors?
A closing tag that does not match the nearest open one, an unescaped ampersand or angle bracket inside text, an unquoted attribute value, and more than one root element.
Where is the error reported?
The first problem is reported with its line and column plus a plain description, so you can jump straight there instead of scanning the whole document.
Is my XML sent to a server?
No. Validation runs entirely client-side in your browser.
Related tools
XML Formatter & Beautifier
This XML formatter re-indents minified or messy XML while preserving comments and CDATA.
XML Viewer
This XML viewer renders any document as a collapsible tree with attributes and copyable paths.
XML to JSON Converter
This XML to JSON converter parses XML into JSON online, preserving attributes and repeated tags as arrays.