XML Minifier

Strip whitespace and comments to shrink XML.

XML input
Minified XML

Free online XML minifier. Remove the whitespace between tags and strip comments to compress XML into a compact, single-line document. Runs in your browser — nothing uploaded.

How to use the XML Minifier

  1. 01Paste your XML into the input box.
  2. 02The minified, single-line output appears instantly.
  3. 03Copy the result — comments and gaps between tags are removed.

Frequently asked questions

Does minifying change my data?

No — only whitespace between elements and comments are removed. The elements, attributes and text content are unchanged.

Are comments removed?

Yes. XML comments (<!-- ... -->) are stripped so the output is as small as possible.