Readable XML
SOAP responses, RSS feeds, sitemaps, Maven and Android files and invoices such as the Brazilian NF-e are XML, and they often arrive as one long line. Formatting puts each element on its own line, indented by depth, so the structure is clear. Short elements with only text, like <price>12.50</price>, stay on one line.
The formatter also checks well-formedness: every start tag must be closed in the right order. If </order> appears while <item> is still open, the page tells you which tag is wrong and on which line.
Worked example
<order id="7"><item sku="A1">Mug</item><item sku="B2"/><note><!-- gift --></note></order>
formats as
<order id="7">
<item sku="A1">Mug</item>
<item sku="B2"/>
<note>
<!-- gift -->
</note>
</order>
Minify does the reverse and also removes comments.
How this works
The page splits the XML into tokens: declaration, comments, CDATA, DOCTYPE, start tags, end tags, empty-element tags and text. While doing so it keeps a stack of open elements and stops at the first end tag that does not match the element that is open, or at the end if an element is never closed. Formatting writes each token on its own line, indented by nesting depth, and keeps elements that contain only text on one line. Minify joins the tokens without whitespace and drops comments. This checks well-formedness only, not an XSD schema. Everything runs in this tab.
Frequently asked
Does it validate against a schema (XSD)?
No. It checks well-formedness: every tag closed, in the right order, with quoted attributes.
Will formatting change my data?
Only whitespace between tags. Avoid it where whitespace is significant, such as xml:space="preserve" content.
Are comments and CDATA kept?
Formatting keeps them. Minify keeps CDATA and removes comments.
Is my XML uploaded?
No. Everything runs in your browser.
Sources
Reviewed Oct 17, 2026 · test vectors fixtures/dev/xml-formatter/