XML Formatter

Paste or type XML and it is checked and formatted as you go. A document you are still writing is not an error, so nothing is flagged until you stop typing or leave the box.

How it works

The formatter checks that every opening tag has a matching closing tag, in the right order, then re-prints the document with one tag per line, indented by nesting depth. A mismatched or unclosed tag is reported with the specific tag name involved, instead of a generic parse error.

Scope is deliberately limited to what most hand-written or API-response XML actually uses: elements, attributes, text content, and self-closing tags. An XML declaration, DOCTYPE, or comment is passed through on its own line rather than fully parsed, and CDATA sections and namespaces are not given special handling — this is a formatter for everyday XML, not a full spec-compliant parser.