XML Minify
Minify XML by removing the indentation and line breaks between tags, so the document is smaller but still well-formed and means exactly the same. Runs in your browser.
Suggested tools
About XML Minify
XML Minifier removes the indentation and line breaks between tags, producing compact XML that is smaller to store and send — useful for SOAP requests, sitemaps, feeds and configuration embedded in other files.
The XML is checked for well-formedness first, so you get a clear error instead of a broken result, and text inside elements is left untouched. Everything runs locally in your browser — the text you paste is never uploaded.
How to use XML Minify
- Paste XML or upload an .xml file.
- Press Minify.
- Copy or download the compact XML.
Key features
- Removes whitespace between tags
- Checks well-formedness first
- Element text and attributes untouched
- Pair with XML Formatter to make it readable again
Example
Whitespace between tags removed.
<order> <id>5</id> <item>Pen</item> </order>
<order><id>5</id><item>Pen</item></order>
When to use XML Minify
- Compacting SOAP requests and API payloads.
- Reducing the size of large XML exports or sitemaps.
- Embedding XML in another file or a single database field.
Tips and common problems
- Only whitespace between tags is removed; text and comments stay.
- In documents that mix text and tags (like XHTML), whitespace between inline tags can matter.
- Use XML Formatter to make minified XML readable again.
Frequently asked questions
No. Comments and processing instructions are kept; only whitespace between tags is removed.
In data-oriented XML it does not. In documents with mixed content (text and tags mixed, as in XHTML), whitespace between inline tags can matter — check those results.
Use XML Formatter and press Beautify.