Useful Hacks

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

  1. 1Paste XML.
  2. 2The minified output updates automatically.
  3. 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

Related tools

All developer tools

Ready to use XML Minifier?

XML Minifier

Search tools

Search for any tool by name, category or keyword