XML Minifier
Strip comments and insignificant whitespace to compress XML.
Processed locally in your browser. Nothing you enter is uploaded or stored.
- Uses the browser's own DOMParser/XMLSerializer, so it only removes whitespace that's genuinely insignificant.
- Real text content inside elements is never touched, even if it contains meaningful spacing.
- Runs in your browser; documents aren't uploaded.
Why this is private
- Processed locally in your browser. Nothing you enter is uploaded or stored.
- Open your browser's DevTools → Network tab while using this tool — you won't see a request carrying your input, because it never leaves your device.
- Nothing you enter is uploaded to a server or shared with us — the processing happens entirely on your device.
Overview
Strips XML comments and the whitespace-only text between tags (like the indentation your editor added), using your browser's own XML parser — real text content, including any internal spacing, is left untouched.
How to use it
- 1Paste XML.
- 2The minified output updates automatically.
- 3Copy it or download as .xml.
Examples
Formatted to minified
Input
<root> <item id="1">Value</item> </root>
Output
<root><item id="1">Value</item></root>
Tips
- Because this uses a real XML parser, malformed XML is rejected with an error rather than silently producing a broken result — fix the error shown, or check it with XML Validator first.
Frequently asked questions
What people use it for
Shrink an XML config or manifest before deploying itStrip the indentation whitespace from a hand-edited config file.
Compress an XML API payloadRemove formatting overhead before sending or storing an XML document.
Clean up an exported XML fileStrip comments and whitespace a tool left behind before archiving it.
Related guides
- How to read JSON with a tree viewerA tree viewer turns a wall of brackets into a structure you can expand, search and copy paths from. Here's how to use one effectively.
- JSON parse errors explained: 'Unexpected token', 'Expected comma or brace', and the restWhat each common JSON error message actually means, the usual cause, and how to find the spot fast using line and column.
- How to format JSON (and actually understand the errors)JSON looks like a JavaScript object but follows stricter rules. Here's what those rules are and how to read the errors when they're broken.
Related tools
All developer toolsReady to use XML Minifier?
XML Minifier