XML Minifier

Compress XML without breaking CDATA, namespaces, or xml:space - free, no signup required.

Input XML
Minified Output
Original: 0 B Minified: 0 B Saved: 0.0%

XML Full Form

XML stands for eXtensible Markup Language - a structured text format used for configuration files, document storage (OpenDocument, OOXML), enterprise message payloads (SOAP), feeds (RSS, Atom), and many other data interchange scenarios. XML files are typically pretty-printed with indentation and comments for humans; minification strips those away to reduce size.

What this tool does

When you need an XML minifier

Privacy

Everything runs locally in your browser. Your XML is never sent to our servers. You can minify internal configs, SOAP envelopes with auth tokens, or private document payloads without anything leaving your machine.

Frequently Asked Questions

Will minifying break my signed or validated XML?
If your XML is signed (XML Digital Signature) or canonicalized before hashing, do not minify after signing - whitespace changes invalidate the signature. Minify first, then sign. The tool preserves CDATA and xml:space="preserve", which covers the common cases where whitespace is semantically meaningful.
Does it preserve namespaces and attributes?
Yes. All namespace declarations, attribute values, and processing instructions (<?xml ...?>) are retained. Attribute whitespace inside quoted values is preserved - only whitespace between tags and at the boundaries of text nodes is collapsed.
What about entity references like &amp;?
Entity references are passed through untouched. The minifier is a text-level tool - it does not parse to a DOM or decode entities, so &amp;, &lt;, &#123; and custom entities are preserved exactly.
How much can I realistically save?
Indented XML usually shrinks by 20-50%, depending on nesting depth and verbosity. After gzip the savings are smaller but real - minification removes bytes the compressor still has to encode.
Is my XML uploaded anywhere?
No. All minification happens in your browser. Nothing is sent to our servers, logged, or cached anywhere except the current browser tab.
Can I reverse the minification?
Click Beautify to indent the XML with one element per line. Stripped comments are not recoverable, but the tag structure is fully restored and readable.