XML Formatter
Pretty-print and indent XML, however badly it arrived.
Your data never leaves your browser
This tool runs entirely on your computer. What you paste or drop is never uploaded, never stored and never seen by us — close the tab and it's gone. How we know
Sign up to run — no credit card required.
Press Run to see the output. Sign up takes ten seconds — no credit card required.
Worked example
<a><b>1</b></a><a>
<b>1</b>
</a>This example is one of XML Formatter's test cases — if the tool stopped producing this output, the build would fail.
Questions
- Will it reformat a minified single-line XML?
- Yes — that's the main use. It re-indents with two spaces regardless of how the document arrived.
- What if the XML isn't well-formed?
- It refuses and tells you the line and column, rather than emitting a mangled document that looks formatted but isn't valid.
Related tools
XML Validatortakes xml
Check whether XML is well-formed and see exactly where it breaks.
XML to JSONtakes xml
Convert XML into JSON, attributes and text nodes included.
XML Difftakes xml
Compare two XML documents element by element.
XPath Testertakes xml
Run an XPath against your XML and see what it selects.