XML Formatter

Paste XML to indent it neatly or compact it. Badly formed XML is reported with the parser's message instead of a broken result.

  • Free, no account needed
  • Checked by 4 test cases
  • Runs in your browser: nothing you enter is sent to us
  • Updated November 19, 2026

Processed in your browser. Nothing you paste is sent to a server.

Result

                
            

How to use this tool

  1. Paste XML or open an .xml file.
  2. Choose format or minify and the indent.
  3. Copy or download the result.

How it works

The browser's XML parser checks that the document is well-formed. The tool then writes it out again node by node: elements and attributes, text, comments, CDATA sections and processing instructions are kept. Whitespace-only text between elements is replaced by the new indentation; other text is kept exactly.

Limitations

  • Well-formedness is checked, not validity against a schema (XSD or DTD).
  • Mixed content (text and elements side by side) is kept on one line to avoid changing its meaning.

Privacy and data

Everything happens in your browser. What you paste or open is never sent to our server, logged or stored, and the page works offline once loaded.