Minify XML files instantly with live preview. Clean up whitespace, strip declarations, and export compact XML all right in your browser.
How to Use:
- Paste your XML into the input box or use “Choose File” to import a
.xml
,.txt
, or.html
file - Use the toggle “Preserve XML declaration” to keep or remove the
<?xml ...?>
line - Turn on “Remove empty text nodes” to eliminate spaces between tags
- Enable “Maximize output” to enlarge the output box for easier viewing
- Select a mode under Minify Mode:
- Aggressive: strips all line breaks and redundant spaces
- Preserve boundaries: keeps spacing within elements intact
- Output updates automatically as you edit
- Click Copy Output to copy the result
- Click Export to File to save as
.xml
- Use Clear All to reset input, output, and all toggles
- Output counter shows total characters in the minified result
What Minify XML can do:
Minify XML simplifies and compacts any XML file without touching a server. Whether you’re trying to save space or just want a neater version of your markup, this tool makes it fast. Keep the declaration if you need to. Strip out blank lines and whitespace if you don’t. Use safe mode when you want the tags close but still readable, or go full-aggressive when file size is what matters. Everything happens live, right in your browser, and you’ve got full control over what gets preserved or removed.
Example:
Before:
<?xml version="1.0"?>
<note>
<to> Tove </to>
<from> Jani </from>
<heading>Reminder</heading>
<body> Don't forget me this weekend! </body>
</note>
After (Aggressive):
<?xml version="1.0"?><note><to>Tove</to><from>Jani</from><heading>Reminder</heading><body>Don't forget me this weekend!</body></note>
Common Use Cases:
Developers often need to minify XML for APIs, config files, or embedded markup. It’s perfect for reducing payload size, removing excess whitespace, or just cleaning up for version control. Whether you’re debugging, prepping for production, or tidying up exports from other tools, Minify XML gives you full control and instant feedback.
Useful Tools & Suggestions:
After minifying, run Convert XML to Base64 if you need to embed the file or transmit it compactly. And if you ever need to reverse it, Prettify XML brings the formatting back for easier reading.