Skip to content

XML Minifier

Strip whitespace and comments from XML for transport, leaving attribute values and CDATA untouched.

Input

Output

Reindenting and checking structure

The formatter reindents elements so nesting is visible, and the minifier strips whitespace and comments back out for transport.

The validator is a structural check: it verifies that every tag is closed and correctly nested and reports the line where that breaks. It does not validate against a DTD or an XSD schema.

Frequently asked questions

Does it validate against a schema?

No. It checks well-formedness — balanced, correctly nested tags — which is what catches the overwhelming majority of hand-edited XML problems.

Are attributes and CDATA preserved?

Yes. Only whitespace between elements is changed; attribute values, CDATA sections and processing instructions are left untouched.

Related tools