Strip indentation, line breaks and comments from XML to get the smallest valid version.
Loading the tool...
How to use XML Minify
Paste your XML.
Choose whether comments should be removed.
Copy the compact result.
About XML Minify
Minified XML is useful when you send it over the network, embed it in another document, or store it in a column that has a size limit. All the whitespace between tags goes, and with it the comments if you want them gone.
The tool checks that your XML is well formed before it minifies, so you do not compress a broken document without noticing.
Frequently asked questions
Is minified XML still valid?
Yes, as long as the whitespace you remove is not significant for your application. In data-style XML it never is.
What happens to whitespace inside text?
Runs of spaces and line breaks inside text are collapsed into a single space, and the text is trimmed at both ends.