XML Formatter

Beautify, minify or validate XML at any indent from 0 to 10 spaces or a tab — paste, format, copy. 100% in your browser, no upload.

🔒 Runs in your browser — nothing is uploaded.

Make messy XML readable — or compact it

Paste XML and this tool re-indents it into a clean, nested structure so you can actually read it, or minifies it back down to a single line with the whitespace between tags removed. Indent with any whole number of spaces from 0 to 10, or a tab — a width outside that range is refused with a sentence rather than quietly formatted at some other size. With Collapse content ticked — it starts on, and the setting is remembered on this device — short leaf elements like <name>Ann</name> stay on one line so the output isn’t needlessly tall. Untick it to put every node on its own line, which is what a line-by-line diff wants.

Switch to Validate to check the XML is well-formed — it flags the first mismatched, unclosed or stray tag with a line number so you can find the break fast. Everything runs in your browser — the XML is never uploaded, so it’s safe for config files, SOAP payloads, RSS and API responses.

Frequently asked questions

What is the difference between beautify and minify?

Beautify adds line breaks and indentation to make nested XML readable; minify removes the whitespace between tags to make the file as small as possible.

Does it validate my XML?

The Validate mode checks that your XML is well-formed — flagging mismatched, unclosed or stray tags with a line number — but it does not check the XML against a schema or DTD.

Is my XML uploaded to a server?

No. Formatting happens entirely in your browser, so config files and API payloads never leave your device.

Can I choose tabs instead of spaces?

Yes. In beautify mode you can indent with a tab, or with any whole number of spaces from 0 to 10.