XML Formatter
Indent XML for reading or minify it for transport, with unbalanced tags reported by line number.
Processed locally in your browser — nothing is uploaded.
0 characters
Formatted XML
Output appears here…About XML Formatter
Pretty-print XML with consistent indentation, or collapse it to a single line. Declarations, comments, CDATA sections, and self-closing tags all survive the round trip untouched.
Short text nodes stay on the same line as their element, so a document full of small values does not balloon to three times its height.
Common uses
- Read an RSS feed, sitemap, or SOAP response that arrived as one long line
- Find the mismatched tag in a config file that a parser rejected
- Minify an XML payload before embedding it in a test fixture
Example
Input
<catalog><book id="1"><title>Widgets</title></book></catalog>
Output
<catalog>
<book id="1">
<title>Widgets</title>
</book>
</catalog>Limitations
- Structural formatting only — no DTD or XSD schema validation, and entities are left as written
- Attribute order and whitespace inside text nodes are normalised, not preserved byte-for-byte