Skip to content
Input
XML
Limit
1 MiB
Runtime
Browser

Minify XML without flattening mixed content

Remove safe presentation whitespace and compact markup while retaining text whose position can affect the represented document.

Local processingNo sign-upNo network access

Minify XML

Inputs are limited to 1 MiB and stay in this browser tab.

Paste or edit the source. Tool Swim does not upload or save it.

Minified XML

Nothing is placed in a URL, account, or remote log.

What this tool does

XML 1.0, bounded, and local

Removing every gap between tags is unsafe when elements and character data share a parent. This minifier distinguishes indentation-only nodes from mixed-content text rather than applying a blanket regular expression.

Compact output still has XML semantics

Empty-element spelling, declaration layout, and insignificant indentation may normalize. Character data, CDATA content, comments, processing instructions, and namespace identities remain part of the parsed document.

Smaller is not automatically faster

Compression at the HTTP layer often saves more bytes than source minification. Use this result when compact source is useful, then test the consuming application.

Primary references

Questions and answers

Related XML tools