XML Compressor
Compress XML locally and compare UTF-8 sizes. Compact empty elements, optionally strip comments and indentation, and preserve mixed text and xml:space.
Choose XML whitespace compression settings
XML Compressor: how to use it
- Supply an XML document and compress once with the default settings.
- Optionally remove comments or whitespace between element-only children.
- Review the byte counts and output, then download compressed.xml.
Limits and notes
Local files must be UTF-8 and at most 4 MiB. XML input supports up to one million UTF-16 code units, 100,000 nodes and 128 element levels. DTDs are excluded. Normalization can change attribute quoting, character references and empty-element spelling. Optional indentation removal respects inherited xml:space="preserve". Digital signatures depend on separate canonicalization rules.
How your privacy works →XML Compressor: common questions
Will the compressor join words around an inline element?
An element containing non-whitespace text or CDATA keeps its child text. Optional indentation removal applies to whitespace-only children of an otherwise element-only container.
Why is a compact file the same size as the input?
The default mode keeps the input when normalized markup would be larger. The measured byte counts report the actual result.