Developer Tools

XML Minifier

Minify XML or SVG while validating syntax and optionally removing comments.

About this tool

Minify XML or SVG while validating syntax and optionally removing comments.

What this tool handles

The minifier validates the complete XML document, removes indentation whitespace between elements and keeps comments unless you explicitly choose to remove them. Declarations, namespaces, CDATA and element values remain available.

Important behavior

Whitespace inside text may be significant. The tool preserves mixed text content and xml:space="preserve" regions rather than applying an unsafe global whitespace replacement.

Private browser processing

The selected file and pasted text are processed locally in this browser tab and are not sent to the server.

How to use

Load or paste valid XML or SVG, decide whether comments may be removed, process the document, compare input and output sizes and download the full minified file.

FAQ

What whitespace does the XML minifier remove?
It removes indentation-only text nodes between elements. It does not globally trim the text stored inside elements.
Are XML comments removed automatically?
No. Comments are preserved by default. Enable the remove-comments option only when comments are not required by your workflow.
Does minification validate the document?
Yes. Invalid XML produces an error and the previous downloadable result is cleared.
Can the tool minify SVG?
Yes. Valid SVG files can be minified as XML, including namespaces and attributes.
Is my XML uploaded?
No. Validation and minification are performed locally in the browser.