XML Minify

Minify XML by removing the indentation and line breaks between tags, so the document is smaller but still well-formed and means exactly the same. Runs in your browser.

Suggested tools

JSON Minify

Minify / compact JSON.

JSON
Open Tool

HTML Minify

Remove comments and extra whitespace from HTML safely.

HTML
Open Tool

CSS Minify

Shrink CSS by removing comments and spaces, keeping it valid.

CSS
Open Tool

JSON to XML

Convert JSON into well-formed XML.

JSONXML
Open Tool

XML to JSON

Convert XML into clean JSON.

XMLJSON
Open Tool

XML Formatter

Beautify, minify and validate XML instantly in your browser.

XML
Open Tool

About XML Minify

XML Minifier removes the indentation and line breaks between tags, producing compact XML that is smaller to store and send — useful for SOAP requests, sitemaps, feeds and configuration embedded in other files.

The XML is checked for well-formedness first, so you get a clear error instead of a broken result, and text inside elements is left untouched. Everything runs locally in your browser — the text you paste is never uploaded.

How to use XML Minify

  1. Paste XML or upload an .xml file.
  2. Press Minify.
  3. Copy or download the compact XML.

Key features

  • Removes whitespace between tags
  • Checks well-formedness first
  • Element text and attributes untouched
  • Pair with XML Formatter to make it readable again

Example

Whitespace between tags removed.

Input
<order>
  <id>5</id>
  <item>Pen</item>
</order>
Output
<order><id>5</id><item>Pen</item></order>

When to use XML Minify

  • Compacting SOAP requests and API payloads.
  • Reducing the size of large XML exports or sitemaps.
  • Embedding XML in another file or a single database field.

Tips and common problems

  • Only whitespace between tags is removed; text and comments stay.
  • In documents that mix text and tags (like XHTML), whitespace between inline tags can matter.
  • Use XML Formatter to make minified XML readable again.

Frequently asked questions

No. Comments and processing instructions are kept; only whitespace between tags is removed.