XML Formatter & Minifier

Paste XML to pretty-print with proper indentation, or compress it to a single line.

Format & minify

Formatting walks the DOM and re-indents every element at your chosen width while keeping attribute order; minifying collapses whitespace between tags. Parse errors are surfaced instead of silently failing.

Frequently asked questions

Comments kept?

Comments are preserved by the minifier; the formatter keeps element structure only.

Huge files?

Formatting runs locally — a few hundred KB is comfortable.

Invalid XML?

A parse-error hint appears and the output stays empty.