AZ Tools

XML Formatter & Minifier

Developer

Paste XML and reformat it instantly — pretty-print it with 2 spaces, 4 spaces or tabs, or minify it down to a single line. The XML is parsed with the browser's real XML parser, so malformed documents are flagged, and comments, CDATA sections and processing instructions are preserved. Everything runs locally in your browser — nothing is uploaded.

How to use

  1. Paste your XML into the input box.
  2. Choose Beautify (and an indent size) or Minify.
  3. Copy the formatted XML from the output box.

Frequently asked questions

What does beautify do?
It re-indents the document by nesting depth so the structure is easy to read, putting each element on its own line. Whitespace between elements is normalized.
What does minify do?
It removes the whitespace between elements and the indentation, collapsing the document to a single line — useful for compact storage or transport.
Does it keep comments and CDATA?
Yes. Comments, CDATA sections and processing instructions are preserved, and special characters in text and attributes are properly escaped.
What if my XML is invalid?
The document is parsed with the browser's XML parser. If it isn't well-formed, an error message is shown instead of broken output.

Related tools