Your data never leaves this tab

Free XML Minifier Online

Strip whitespace from XML to produce compact, minified output — browser-only using DOMParser.

XML Input
Minified XML

How it works

1

Paste XML

Paste formatted or human-readable XML into the input.

2

Minify

Click Minify XML or press Ctrl+Enter. Whitespace between tags is stripped.

3

Copy or download

Copy the compact single-line XML output.

4

Browser-only

DOMParser runs locally — your XML is never uploaded.

Common use cases

Reduce payload size

Strip whitespace from SOAP requests or XML API payloads to reduce bytes transferred.

Config file optimization

Minify XML config files before bundling them into production deployments.

SVG optimization

Strip whitespace from SVG files before inlining them in HTML or CSS.

Data interchange

Minify XML before embedding it in JSON strings or other data formats where extra whitespace wastes space.

Frequently asked questions

Does minifying change the data?

No — only whitespace text nodes between tags are removed. Attribute values and element content are preserved.

Are comments removed?

Yes — XML comments are stripped during minification.

Can I minify invalid XML?

No — DOMParser validates well-formedness first. Use the XML Validator to find and fix errors before minifying.

Is my XML sent to a server?

No. DOMParser is a native browser API that runs locally.