XML Minifier

How it works
Indent
Valid XML

Input XML

No problems found. This is valid XML.

About XML Minifier

Pretty-printed XML can carry a lot of indentation. The minifier removes the whitespace between tags, collapses runs of spaces in text, and drops comments, so the same document takes up less space.

That helps when you embed XML in a request body, a string literal or a single-line config value. The XML is validated first, so malformed documents are reported instead of being minified.

How to use it

  1. Paste your XML into the Input panel. Minify is already switched on.
  2. Make sure the status badge shows Valid XML, or fix the errors in Problems.
  3. Copy the compact XML, or Download it as an .xml file.

Frequently asked questions

Are comments removed?

Yes, XML comments are dropped when minifying. CDATA sections, processing instructions and the XML declaration are kept.

Does minifying change text inside elements?

Leading and trailing spaces are trimmed and runs of whitespace inside text become a single space. If exact whitespace in text matters to you, keep the formatted version.

Is my XML uploaded anywhere?

No. The XML is processed in your browser and never sent to a server.

Related tools