XML Formatter and Validator
Paste messy XML and get it back clean: this tool checks whether your XML is well-formed and shows the parser error if it is not, or pretty-prints valid XML with neat indentation. A minify button gives you a compact one-line version.
How to use
- Paste your XML.
- Click Format and validate — valid XML is beautified, invalid XML shows the parser error.
- Or click Minify to remove the indentation again.
Note: Validation uses the browser DOMParser, which checks well-formedness (matching tags, quoting and nesting). It does not validate against a DTD or schema.
Frequently Asked Questions (FAQ)
What does the XML formatter do?
Paste XML and click Format and validate. Valid XML is beautified with clean indentation; invalid XML shows the parser error instead of silent garbage.
Can I minify XML?
Yes. The Minify button removes the indentation again for a compact single-line result.
Does it validate against a DTD or schema?
No. It checks well-formedness only — matching tags, quoting and nesting — using the browser's built-in DOMParser.
Does formatting change my XML content?
No. Formatting only changes whitespace and indentation — your XML data stays exactly the same.