Data and JSON tools Free · No sign-up · No upload

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
Your data
  • Runs on your device. Files are never uploaded.
  • Free and unlimited. No sign-up, no watermark.
Private: processed in your browserNo upload waitIN: XML → OUT: XML
How was XML minifier?
How it works

XML minifier in three steps

No account, no email, no waiting for an upload.

  1. STEP 01

    Bring in your XML

    Use any well-formed XML, including SVG, RSS and config files.

  2. STEP 02

    Convert

    There are no settings: whitespace between tags and comments are removed.

  3. STEP 03

    Copy the compact XML

    The note shows the size before and after.

What you get

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.
Private by design

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 device→Their server→Your device

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

Your device does all the work

The tool loads into your browser once, then works on your file locally. Nothing is sent, so nothing can leak.

Made for real work

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.

Compare

Mediaextractr vs typical upload tools

MediaextractrPrivateTypical upload tools
Your file is uploadedNeverYes
Sign-up neededNoOften, after a few files
Daily file limitNoneOften 1–2 free files
WatermarkNeverSometimes
Wait for upload & downloadNoYes
Speed on very large filesDepends on your deviceDepends 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.

FAQ

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.