About this tool
XML (Extensible Markup Language) is a text format that structures data as a tree of nested elements, each with optional attributes, plus auxiliary constructs like the <?xml?> declaration, comments, CDATA sections, and processing instructions. A formatter re-indents that tree so the hierarchy is readable, while a minifier strips the insignificant whitespace between tags to shrink the payload. This tool uses a hand-written tokenizer (not the browser's DOMParser), so it handles attribute values that contain '>' characters and keeps CDATA content byte-for-byte intact.
Use it to make a dense single-line API response or config file readable before you debug it, to collapse a verbose document down for transport or a diff, or to validate that every tag is balanced — mismatched and unclosed tags are reported with the exact line number so you can jump straight to the problem. It is handy for SOAP envelopes, RSS and sitemap files, Android and Maven configs, SVG, and any XML payload you are eyeballing during development.
This is a well-formedness formatter, not a validator — it checks that tags are balanced and reports the line of any mismatch, but it does not validate against a DTD or XSD schema.
Frequently asked questions
What is the difference between formatting and minifying XML?
Formatting (beautifying) re-indents the document so each nested element sits on its own line, making the structure easy to read. Minifying removes the insignificant whitespace between tags to produce the smallest equivalent document for storage or transport.
Does formatting XML change the data or break CDATA sections?
No. Only insignificant whitespace between elements is adjusted. CDATA sections, comments, and the XML declaration are preserved verbatim, including any '<' or '>' characters inside CDATA, so the document's meaning is unchanged.
Is my XML uploaded to a server?
No. All formatting and minifying happens entirely in your browser with client-side JavaScript. Your XML never leaves your device and is not sent to any server.