XML formatter
Pretty-print or minify XML with tag-nesting checks that name the offending tag.
Related tools
XML formatter
Paste XML and this tool reformats it into cleanly indented markup — or strips it down to a single minified line. It handles the XML you actually meet in a working day: API responses, RSS and Atom feeds, sitemaps, SVG files, Maven and NuGet manifests, Android layouts and the config file a build tool just mangled onto one line.
Formatting puts every tag on its own line and indents children by two spaces, four spaces or a tab — your choice. "Collapse short elements" keeps an element with only text content, like a single SKU or a date, on one line, which keeps data-heavy documents compact and scannable; switch it off and every value moves to its own indented line. Comments, CDATA sections, processing instructions and the XML declaration all survive untouched, and whitespace-only text between tags is tidied away while real text content is kept. Minify does the reverse: it removes the whitespace between tags so the document is as small as it can get without changing its meaning.
While it works, the tool checks that tags nest correctly. A stray closing tag or an element that never closes produces a calm message naming the exact tag, so the fix takes seconds. Know the limits, though: this is a formatter, not a schema validator — it verifies nesting only, and attribute syntax passes through exactly as written, with no DTD or XSD checking.
Everything runs in your browser. No request is sent and nothing is logged, so feeds, exports and configs carrying internal data are safe to paste. The tally shows elements, depth and the size before and after.