XML formatter and beautifier
Validate and pretty-print XML with clean indentation. Runs in your browser.
Runs 100% in your browserHow to format XML
- Paste your XML. Paste minified or messy XML into the input.
- Pick an indent. Choose 2 spaces, 4 spaces or a tab.
- Copy the result. Copy or download the formatted XML.
About XML formatting
XML from APIs, configs and exports often arrives minified or inconsistently indented. Formatting it reveals the structure so you can read and debug it. This tool first parses the document to confirm it is well-formed — catching the most common breakage, mismatched or unclosed tags — and then prints it with the indentation you choose.
Frequently asked questions
- It checks that your XML is well-formed, then re-indents it with consistent nesting. Leaf elements that contain only text stay on one line for readability.
- Yes. It uses the browser's XML parser, so mismatched tags, missing brackets and other well-formedness errors are reported.
- No — it checks well-formedness (correct syntax), not validity against a DTD or XSD. Schema validation needs the schema and is out of scope here.
- No. Formatting happens in your browser.