XML Validator
Check that your XML is well-formed and see exactly what to fix when it isn't.
XML input
Validation result
Invalid XML
Error on line 7, column 16: “&” must be written as & (or start an entity like <).
How to validate XML
- Paste XML on the left, or open or drop an .xml file.
- See instantly whether it's well-formed. Errors show the line, the column and how to fix them, and the line is highlighted.
- Click Go to error, fix it in the editor, and the result updates as you type.
Well-formedness, explained
XML parsers are strict: a single unescaped & or a tag closed in the wrong order makes the whole document unreadable. This XML checker applies the XML 1.0 well-formedness rules — properly nested and closed tags, a single root element, quoted and unique attributes, valid names and entities — and stops at the first problem, just like a real parser, with an explanation you can act on.
Valid documents show a summary: the root element, how many elements and attributes it has, and how deeply it's nested.
Common XML errors and fixes
| Problem | Invalid | Valid |
|---|---|---|
| Unescaped ampersand | <t>AT&T</t> | <t>AT&T</t> |
| Mismatched tags | <a><b></a></b> | <a><b></b></a> |
| Unquoted attribute | <img width=10/> | <img width="10"/> |
| HTML entity | <p> </p> | <p> </p> |
| Two root elements | <a/><b/> | <root><a/><b/></root> |
Use cases
- Find why an RSS feed, sitemap or SVG fails to load.
- Check SOAP requests and XML API payloads before sending them.
- Debug build and configuration files such as pom.xml or web.config.
Related tools
Once the XML is valid, indent it with the XML formatter or explore it in the XML viewer. Validating other formats? The JSON validator and YAML validator work the same way, and the HTML validator checks web pages.
Frequently asked questions
- What does the XML validator check?
- Whether the document is well-formed: every tag closed and correctly nested, one root element, attribute values quoted, no duplicate attributes, valid names, and only defined entities and valid character references.
- Does it validate against an XSD or DTD schema?
- No. It checks well-formedness, which is what every XML parser requires first. Schema validation (XSD, DTD, RELAX NG) checks your own rules on top of that and isn't done by this tool.
- Why is an error in XML?
- XML only defines five named entities: <, >, &, " and '. HTML entities like or © don't exist in XML unless a DTD declares them. Use numeric references such as   instead.
- Is my XML uploaded?
- No. The XML is checked in your browser and never leaves your device.