XML Minifier
Shrink XML by stripping the whitespace between tags and the comments, leaving content exactly as it was. The size before and after is shown. Done in your browser.
- No watermark or limits
- Client-side only
- Comments removed
- Shows bytes saved
- Runs on your device. Files are never uploaded.
- Free and unlimited. No sign-up, no watermark.
XML minifier in three steps
No account, no email, no waiting for an upload.
- STEP 01
Bring in your XML
Use any well-formed XML, including SVG, RSS and config files.
- STEP 02
Convert
There are no settings: whitespace between tags and comments are removed.
- STEP 03
Copy the compact XML
The note shows the size before and after.
What XML minifier does, and what it doesn't
We'd rather tell you up front than surprise you after the download.
What you get
- Whitespace between tags removedIndentation and line breaks used only for layout disappear.
- Comments strippedComments take space and carry no data, so they are removed.
- Content preservedText, CDATA, entities and attribute values stay as written.
- Mixed content protectedElements that mix text and tags, or use xml:space="preserve", keep their spacing.
- Checks the XML firstMalformed XML is reported with a line and column rather than minified wrongly.
Good to know
- Not compressionServers can gzip XML on top, which shrinks it far more than removing whitespace.
- Hard to read afterwardsKeep the formatted source and bring it back with the XML formatter.
- Comments cannot be keptThis tool always drops them. If a comment is needed, for example a license note, add it back by hand.
Your data never leave your device
The tool runs inside your browser instead of on our servers, so there is nothing to upload, store or delete afterwards.
Typical online tool upload
Your file travels over the internet, sits on someone else's computer for a while, and you wait for the upload and the download.
Mediaextractr no upload
The tool loads into your browser once, then works on your file locally. Nothing is sent, so nothing can leak.
When people use XML minifier
Shrink a bundled asset
Trim SVG icons or data files before shipping.
Send a smaller request
Reduce the payload for an XML API.
Store compactly
Save space in logs and archives.
Prepare a feed
Remove layout whitespace from RSS or sitemap output.
Mediaextractr vs typical upload tools
| MediaextractrPrivate | Typical upload tools | |
|---|---|---|
| Your file is uploaded | Never | Yes |
| Sign-up needed | No | Often, after a few files |
| Daily file limit | None | Often 1–2 free files |
| Watermark | Never | Sometimes |
| Wait for upload & download | No | Yes |
| Speed on very large files | Depends on your device | Depends on their servers |
What gets removed
Between tags, any run of spaces, tabs and line breaks that is only there for layout is removed. Comments are removed. Everything inside text content and CDATA is kept exactly.
The result is valid XML with the same data, so a parser sees the same document before and after.
Use it wisely
Minified XML is for machines, so keep a readable source:
- Commit the formatted version and minify during your build.
- For a quick look at a minified file, use the XML formatter.
- Check that the minified file is still valid with the XML validator.
- Prefer JSON for lighter payloads? Convert with XML to JSON.
A before and after
A 40 KB hand-indented XML file often shrinks by a quarter to a third after minifying, mostly from indentation and comments. The note shows the exact numbers for your file. If you send the result over HTTP, your server's gzip or Brotli compression will shrink it far further, so minifying is a modest extra.
Questions, answered
How do I minify XML?
Paste the XML and copy the compact result. The page shows the bytes before and after.
Do my XML files leave the browser when minified?
No. Whitespace and comments are removed by script in this page, so private feeds and configs are never uploaded.
Does minifying remove comments?
Yes. Comments are removed along with layout whitespace.
Can minifying break my XML?
No. Text content, CDATA and mixed content are protected, so the document means the same thing.
Is this the same as compressing?
No. Minifying removes whitespace. Compression like gzip is a separate step.
Can I minify XML on a phone?
Yes. Paste the XML in a current phone browser and copy the compact result.