XML Formatter

Beautify or minify XML and report parse errors.

Paste XML and press Format, or use Ctrl/⌘ + Enter.

What this tool does

This XML formatter checks that your document is well-formed, then re-indents it so the structure is easy to read: one element per line, children indented by 2 spaces, 4 spaces or a tab, and elements that contain only text kept on a single line. Comments, CDATA sections, processing instructions and the XML declaration are preserved, while whitespace-only text between tags is dropped. Minify does the opposite and removes all whitespace between tags, giving the smallest equivalent document for embedding in a string or sending over the network. The status line shows the size before and after.

Notes and common errors

Privacy

Formatting runs locally in your browser. Nothing you paste is sent to a server or kept after you leave the page.