XML Formatter & Validator
Format and validate XML online. Beautify with 2 spaces, 4 spaces or tabs, minify, and get an error with a line number when the XML is not well-formed. Everything runs locally in your browser; nothing is uploaded.
Paste XML and choose Beautify or Minify and an indent size. The XML is validated first, so mismatched tags and other errors are reported with a line number.
XML
Formatted XML
Output appears here.Learn more
Well-formed XML
Well-formed XML has one root element, correctly nested and closed tags, quoted attribute values and escaped special characters. A formatter can only indent a document that meets these rules.
Common errors
The usual causes are an unclosed tag, a mismatched end tag, an unescaped ampersand in text and an attribute without quotes.
Frequently asked questions
Does it validate against a schema?
It checks that the XML is well-formed. XSD or DTD validation is not supported.
Are comments and attributes kept?
Yes, both are preserved.
Is my XML uploaded?
No, formatting happens in your browser.