LazyTools

🔒 Every tool runs in your browser — the files and values you enter are never uploaded to any server. How it works

📐 XML Formatter & Minifier

Paste messy or minified XML to format it with clean indentation — or minify it — all on your device.

pretty-printed, 2-space indent

Rate this tool:
Anonymous — no account, no identifier

How the xml formatter & minifier works

The formatter walks the XML tag by tag, indenting each element by its nesting depth and placing short text nodes inline with their element (<title>XML Basics</title>). Minify mode does the opposite — it removes the whitespace between tags to produce the smallest valid XML, while leaving text content untouched. It works on any well-formed XML, including SVG, RSS, sitemaps and config files.

This is a formatter, not a converter — the structure and content are unchanged, only the whitespace differs. Pretty-printing makes machine-generated or minified XML readable for debugging; minifying trims transfer size. Everything runs in your browser, so the document never leaves your device.

Frequently asked questions

How do I format (beautify) XML?

Paste the XML or load a file and it's indented by nesting depth automatically. Choose a 2- or 4-space indent, then copy or download the result.

Can it minify XML too?

Yes — tick "Minify" and it removes the whitespace between tags to produce the smallest valid XML, without altering any text content.

Does it work on SVG and RSS?

Yes — SVG, RSS, Atom, sitemaps and config files are all XML, so the formatter handles them like any other well-formed XML document.

Does formatting change my data?

No — only the whitespace between elements changes. The elements, attributes and text content are preserved exactly.

Is my XML uploaded?

No — formatting runs entirely in your browser and nothing is transmitted.

Related file converters