XML Formatter

Pretty-print or minify XML and catch well-formedness errors.

Runs entirely in your browser. Your input is never sent to a server.

About the xml formatter

Make dense XML readable or compact it for transport. The formatter validates well-formedness first, then applies consistent indentation. Comments, CDATA and attributes are preserved.

How to use it

  1. Paste your XML.
  2. Choose Format or Minify and the indent width.
  3. Copy or download the result.

Frequently asked questions

Does it validate against an XSD?

No. It checks that the XML is well formed, not that it satisfies a schema.

Are comments and CDATA kept?

Yes. They are preserved as written.

Related tools