XML Formatter & Validator
Validate and pretty-print XML with clear error messages.
Input
Output
About XML Formatter & Validator
Paste minified or malformed XML and get it back cleanly indented, using the browser's own built-in XML parser to validate it — so a genuinely broken document is flagged as invalid rather than silently reformatted wrong.
Real validation, not a guess
Validation uses the browser's built-in DOMParser, the same parser the browser itself relies on — not a hand-rolled check. If the XML is genuinely malformed, the parser's own error is surfaced directly, rather than attempting to reformat something that isn't valid XML in the first place.
Indentation is built by hand
The browser's native XML tools don't include an indenting pretty-printer, so this tool walks the parsed document itself and rebuilds it with consistent indentation, correctly handling nested elements, attributes, text content, and comments.
How to use it
Paste XML, minified or already formatted, and click to format and validate. A cleanly indented result appears, or a specific error message if the document isn't valid XML.
Use cases
Clean up a minified XML response for readability. Validate an XML document before using it elsewhere. Quickly spot a malformed tag or attribute in a large document.
Limitations
Works entirely on what you paste in — nothing is sent to a server. It formats and validates well-formed XML; it doesn't validate against a specific schema (XSD or DTD).
Does this check my XML against a schema?
No — it validates that the XML is well-formed (properly nested, closed tags, valid syntax), not that it matches a specific schema.
Is my XML sent to a server?
No — parsing, validation, and formatting all happen entirely in your browser.
Is this actually free?
Yes — it's completely free, with no sign-in required.