XML formatter
FormattingPretty-print or minify XML, with validation via DOMParser.
What this tool helps with
XML readability degrades fast once a document is minified or hand-edited across systems. This formatter parses with a proper XML parser, validates that tags balance, and reflows the document with consistent indentation while preserving CDATA blocks and significant whitespace where the spec demands it. It runs in the browser, so API responses and configs that aren't yours to share elsewhere can be tidied up without leaving your machine.
How to use XML formatter
- Open the XML formatter page and paste, type, or generate the xml input you want to work with.
- Pick the options you need so the tool can pretty-print or minify XML, with validation via DOMParser
- Copy the format result with one click and use it in your next step — terminal, editor, ticket, or anywhere else you need it.
Common uses
- Reach for XML formatter when you need to pretty-print or minify XML, with validation via DOMParser during debugging, code review, or content preparation.
- Skip installing a desktop xml app — open this formatting utility on a shared machine, an iPad, or a colleague's laptop and it just works.
- Bookmark or share the page when you and your team keep coming back to the same xml, format, pretty, and minify workflow.
FAQ
Does it validate against a schema?
It validates well-formedness — tags balance, attributes are quoted, characters are legal. Validating against an XSD or DTD is a separate step that requires the schema; this tool is about structural cleanup, not schema enforcement.
Will reformatting break my signed XML?
Probably, yes. XML signatures are computed over canonical bytes — any whitespace change invalidates them. Don't reformat signed XML before transmission; use it for diagnostics only.
What about CDATA and comments?
Both are preserved verbatim. The content inside CDATA is untouched even if it looks like XML, which is the whole point of CDATA. Comments are kept at their original positions.