What formatting does
XML is whitespace-tolerant: a document with no line breaks behaves identically to a nicely indented one, but the indented version is far easier for a human to read and diff. A formatter re-emits the same tree with one element per line and a fixed indent per nesting level.
This tool parses your XML with the browser's DOMParser, then walks the node tree and prints each element on its own line, indenting children by your chosen width. Because it works on the parsed tree rather than text, it can also catch structural errors.
Worked example
The one-line input <root><item id="1">Hello</item></root> becomes:
<root><item id="1">Hello</item></root>Validation and minify
If the markup is not well-formed — an unclosed tag, a stray &, mismatched names — the parser reports a parse error and the tool shows it instead of mangling the text. Minify mode does the reverse: it removes the whitespace between tags to produce the smallest valid one-line document, useful for transport or storage. Everything runs locally, so private XML never leaves your browser.