Skip to content
Format XML

Free XML minifier — no signup, no install

Minify XML online, 20–40% smaller

An XML minifier that strips indentation and line breaks from your markup and returns it as a single compact line. Paste up to 5 MB, optionally strip comments, catch syntax errors with the exact line and column — all in the browser, all free.

  • 100% free
  • No signup
  • Up to 5 MB
  • 20–40% smaller
  • Preserves data
Minified XML

The formatted result appears here.

Paste XML, drop a file, or press Ctrl+V anywhere on this page.

How to minify XML online

Three steps — paste, check the settings, copy the result. No signup, no install.

  1. Load your XML into the minifier

    Paste XML into the left panel, drag and drop an .xml file onto the editor, or press Ctrl+V (⌘V on Mac) anywhere on the page. The minifier accepts documents up to 5 MB — .xml, .xsd, .xsl, .svg, .rss, .plist, and every other XML dialect.

  2. Minify or adjust settings

    The minifier is active by default: your XML is collapsed to a single line with all unnecessary whitespace removed. Tick 'Strip comments' to drop every <!-- … --> block too. Need the opposite? Switch to Beautify to re-indent the document instead.

  3. Copy or download the minified output

    The right panel updates as you type. Click Copy to put the minified result on your clipboard, or Download to save it as a .min.xml file. If the XML has a syntax error, the status bar shows the exact line, column, and the offending source line.

Technical specifications

Accepted inputAny XML — .xml, .xsd, .xsl/.xslt, .svg, .rss, .atom, .wsdl, .kml, .plist, .config, pom.xml
MinificationRemoves indentation and line breaks, collapses the document to one line
Typical savings20–40% smaller than indented input
Maximum document size5 MB, about 150,000 lines
ValidationWell-formedness check reporting the line and column of the first error
Preserved exactlyText content, attribute values, XML declaration, DOCTYPE, CDATA, comments (unless stripped), entities, namespace prefixes
Processing locationYour browser — the XML is never uploaded to a server
PriceFree, no signup, no limit on the number of documents

Frequently asked questions

What does minifying XML do?

Minifying removes all unnecessary whitespace — indentation, line breaks between tags, and trailing spaces — and collapses the document to a single line. The XML is semantically identical but typically 20–40% smaller, which speeds up network transfers and reduces storage.

Does minifying change my XML data?

No. Only insignificant whitespace between tags is removed. Text content inside elements, attribute values, CDATA sections, entities, and the XML declaration are preserved exactly. The document means the same thing before and after minification.

Is this XML minifier free?

Yes, completely free with no signup, no daily limit, and no watermark or credit line added to the output. Minify as many documents as you need.

What is the maximum file size?

5 MB per document, roughly 150,000 lines of typical XML. A 2 MB file minifies in well under a second on an average laptop. Above 5 MB the tool asks you to split the document to avoid freezing the browser tab.

Is my XML uploaded to a server?

No. The parser and minifier run entirely in JavaScript inside your browser tab. Nothing is sent over the network, which also means minifying keeps working after you go offline.

Can I also beautify XML here?

Yes. Flip the toggle from Minify to Beautify and pick 2-space, 4-space, or tab indentation. For a formatting-first workflow, see the XML formatter page.

How much smaller will my XML get?

It depends on the original indentation. A 4-space-indented document with deep nesting can shrink 30–40%. A document that is already fairly compact may only lose 5–10%. The status bar shows the exact percentage after each minification.

Does it handle SVG, RSS, SOAP, or Maven pom.xml?

Yes. Every XML dialect is treated the same way — SVG artwork, RSS and Atom feeds, SOAP envelopes, WSDL, XSD schemas, Android layouts, and .plist files. Fragments with multiple root elements are minified too, instead of being rejected.

When to minify XML

Minified XML is the right choice whenever a human will not read the file directly: API request and response bodies, configuration payloads sent over the wire, fixture files in test suites, and XML stored in databases or message queues. Removing whitespace saves bandwidth, storage, and parse time with zero loss of information.

Need to go the other way? The XML formatter re-indents minified XML into a readable tree with your choice of 2 spaces, 4 spaces, or a tab per level. The XML validator focuses on error detection, reporting every well-formedness issue with its line and column.

Where your XML is processed

Everything happens in the browser tab you are reading this in. The document you paste is parsed and minified by JavaScript on your own machine and is never uploaded, logged, or stored — which is also why the minifier keeps working after you disconnect from the internet.