XML Formatter and Validator

Check that XML is well-formed and pretty-print or minify it. Errors are reported with their location.

Runs in your browser. Your input is processed on your device and is not uploaded to our server.

How to use the XML Formatter and Validator

  1. Paste your code or open a file.
  2. Choose the indentation and click Format.
  3. Check the result and the size change, then copy or download it.

The XML is parsed with your browser’s standards-compliant XML parser, so well-formedness errors such as unclosed tags or invalid characters are reported. Valid XML is re-serialised with consistent indentation; CDATA sections, comments and processing instructions are kept. Validation against an XSD or DTD schema is not performed.

Frequently asked questions

What is the difference between well-formed and valid?
Well-formed XML follows XML syntax. Valid XML also matches a schema (XSD or DTD). This tool checks well-formedness.