XML Minifier
Minify XML by removing whitespace
Loading tool…
How to use this tool
Remove XML comments while preserving meaningful whitespace by default. Indentation removal is a separate opt-in choice.
Paste the XML into XML input.
Leave indentation removal unchecked unless spaces between element-only children are insignificant, then choose Minify.
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.