XML Minifier
Example
Input:
<a> <b>x</b> </a>
Output:
<a><b>x</b></a>
About this converter
For data XML (sitemaps, feeds, config payloads, SVG), the indentation is for humans and the bytes are for machines. This minifier removes comments and inter-element whitespace only — text content inside elements is preserved, because in XML, unlike HTML, whitespace can be significant (xml:space="preserve" exists for a reason), and the tool will not guess otherwise. If your XML is a document format (DocBook, XHTML), keep your formatting; if it is data, minified output parses to the identical tree.
Frequently Asked Questions
Is whitespace inside elements touched?
No — only whitespace strictly between tags and comments are removed. Element text is preserved verbatim.
Does the output stay well-formed?
The transformation cannot unbalance tags; if the input parsed, the output parses to the same tree.