XML Minifier

Minify XML by removing whitespace

Processed securely in your browser

Loading tool…

How to use this tool

Remove XML comments while preserving meaningful whitespace by default. Indentation removal is a separate opt-in choice.

  1. Paste the XML into XML input.

  2. Leave indentation removal unchecked unless spaces between element-only children are insignificant, then choose Minify.

  3. Compare the output and character count; copy or download the XML.

Practical example

A comment between two elements can be removed without removing a space inside a text node.

Limits and troubleshooting

DTDs are rejected. Whitespace-sensitive consumers may interpret indentation as data, so do not enable the optional compact setting just to obtain a smaller count.

About XML Minifier

Remove XML comments while preserving text whitespace by default. Indentation removal is optional; DTDs are rejected. All processing happens directly in your browser — your files never leave your device.