Skip to content
MewixMewix

XML formatter

Paste XML, run the formatter, and get one tag per line when the document is well-formed — otherwise you see the parser error.

Updated by the Mewix team

Pretty print without a desktop app

Single-line XML from APIs is awkward to diff. After a well-formed check via DOMParser, the formatter inserts newlines between adjacent tags by turning >< into >\n<. Your markup never leaves the browser.

Well-formed only, not schema valid

Missing closing tags, illegal characters, or mismatched names still fail before layout runs — the same behaviour as a basic XML well-formedness test. XSD or DTD validation is out of scope; fix structure first, then validate against schemas in your toolchain.

Questions

Does formatting change text inside elements?

The pass only adds breaks between tags. Character data and attributes stay on the same lines as before unless they sat between >< boundaries.

Will HTML pages work the same way?

HTML5 tolerates many constructs XML rejects. Loose HTML may fail the XML parser even when browsers render it fine.