About this tool
The validator checks that every tag is closed in the right order, that attributes are quoted and unique, and that the document has exactly one root element. When something is wrong it shows the offending line with a caret under the column. Valid documents get a quick summary of their root element, element count, attributes and nesting depth. The check runs locally in your browser.
How to use XML Validator
- Paste or type XML into the box.
- Read the result below as you type.
- Jump to the reported line and column to fix the error.
- Repeat until the document is reported as well-formed.
Frequently asked questions
Does it check my DTD or XSD schema?
No. It checks well-formedness, the syntax rules every XML document must follow. Schema validation needs the schema file and a validating parser.
Why is a document with two top-level elements rejected?
XML requires a single root element. Wrap the elements in one parent, or treat each as a separate document.