XML Minifier

Remove every insignificant byte of whitespace from XML — text nodes, CDATA and attributes stay intact.

About this tool

Indentation makes XML readable but can double or triple its size. This minifier removes whitespace that exists only between tags while keeping real text content, CDATA sections and attribute values exactly as they are.

How to use it

  1. Paste your XML, or click Sample.
  2. Click Minify XML — the document is checked for well-formedness first.
  3. Copy the compact result back into your application.

Good to know

  • Malformed XML is reported instead of silently minified.
  • Significant text inside elements is preserved — only inter-tag whitespace disappears.
  • Undo any time with the XML Formatter.