How to use it
Paste your XML into the input box and the result appears. Choose “Format” to break the document onto one line per tag with indentation, so the structure is easy to scan, or choose “Minify” to strip the line breaks and whitespace between tags and shrink the file size. In format mode you can also pick the indent width (2 spaces, 4 spaces, or a tab). When text is interleaved with elements (mixed content), “Format” trims and repositions the whitespace between them, while “Minify” leaves that original spacing untouched. If the XML you pasted isn’t well-formed, you’ll see an error message instead of a result, with the line and column of the problem when the browser can determine it.
Well-formed and valid are two different things
This distinction trips people up a lot. “Well-formed” means the document follows XML’s own syntax rules: tags are properly opened and closed, attribute values are quoted, and there’s exactly one root element, among others. “Valid” means the document also follows the structure defined by a specific schema — a DTD or XSD — which elements are required, in what order, and so on. This tool checks well-formedness only, using the browser’s built-in parser; it doesn’t validate against any schema. If you need schema validation, you’ll need a tool built for that specific schema.
Comments, CDATA, and processing instructions are left untouched
Both formatting and minifying leave the content of <!-- comments -->, <![CDATA[ ... ]]> sections, and <?processing instructions?> exactly as they are. When formatting, each of these gets its own indented line; when minifying, only the surrounding line breaks are removed. A <!DOCTYPE ...> declaration and an <?xml version="1.0"?> declaration are also carried over unchanged at the top of the output.
No need to worry about XXE
Parsing XML on a server can be risky because of XXE (XML External Entity) attacks. This tool avoids that entirely: it uses the browser’s built-in DOMParser, which is built not to fetch external DTDs or external entities referenced inside a document. On top of that, everything happens locally in your browser and nothing is sent to a server, so pasting XML from a source you don’t fully trust here can’t put any server at risk.
Privacy
The XML you paste is processed entirely in this browser tab and is never stored or transmitted anywhere. Closing the page discards it.