XML Minifier

Remove whitespace and line breaks from XML to reduce its size.

Input data is processed in your browser
Data is never sent to a server

Tool

0 chars

What is XML Minifier?

XML Minifier removes unnecessary whitespace, line breaks, and indentation from XML to reduce its size. It is useful for optimizing API responses or reducing network transfer size. The XML is validated for well-formedness before minifying, and the character count before and after compression, along with the reduction rate, are shown.

How to Use

  1. Paste XML text into the input field.
  2. Click "Minify" to strip all whitespace and line breaks.
  3. The character count before and after, along with the reduction rate, are displayed.
  4. Click "Copy Result" to copy to clipboard.

FAQ

How is this different from XML Formatter?

XML Formatter handles both pretty-printing and minifying. XML Minifier focuses solely on compression and also shows reduction statistics.

Are comments removed?

Enable the "Remove comments" option to strip <!-- --> style comments before minifying.

Is the XML declaration preserved?

Yes. Any XML declaration (<?xml ...?>) in the input is kept at the top of the minified output.

Is my data sent to a server?

No. All processing happens in your browser using the built-in DOMParser.