XML Formatter
Format, validate and minify XML documents.
Minified or badly indented XML is hard to read.
About XML Formatter
Pretty-print XML with your choice of indentation, or minify it to a single line. The tool checks that the XML is well-formed and points out the first error. Handles attributes, comments, CDATA and the XML declaration.
Minified or badly indented XML is hard to read. This formatter pretty-prints it with the indentation you choose, or minifies it to one line, and tells you when the XML isn't well-formed.
How to use XML Formatter
- Paste your XML.
- Choose Format or Minify and pick the indentation.
- Copy or download the result, or fix the reported error.
Key features
- Pretty print with 1, 2 or 4 spaces.
- Minify to a single line.
- Well-formedness check with an error message.
- Keeps attributes, comments, CDATA and the XML declaration.
Common use cases
- Reading API responses and configuration files.
- Cleaning up XML before committing it.
- Reducing XML size for transport.

