Search tools

Search for a command to run...

XML Formatter & Validator

Pretty-print and validate XML with readable indentation, or minify it — errors point to the exact line and column.

How to use

  1. 1Paste your XML.
  2. 2Pick an indent or Minify and copy the result.

Frequently asked questions

What makes XML invalid?

Common problems are unclosed or mismatched tags, unescaped & or < in text, attributes without quotes and more than one root element.

Are comments and CDATA kept?

Yes. Formatting only changes whitespace between tags; comments, CDATA and processing instructions are preserved.

Does formatting change whitespace inside text?

Leading and trailing whitespace in text-only elements is trimmed. Use Minify=off with care for whitespace-sensitive formats.