Validate, pretty-print and minify XML — with real nesting, attributes, CDATA, comments and mismatched-tag errors.
How to use this tool
A fragment with one root element, or a full document with a declaration.
2 spaces, 4 spaces or tabs.
Format expands nesting readably; Minify compresses to one line.
Mismatched or unclosed tags are reported with their location instead of being silently corrected.
Formula & worked example
<catalog><book id="bk101"><title>XML Guide</title></book></catalog> formats to a nested tree with <book> indented under <catalog>, and a CDATA section like <![CDATA[Price < 10]]> survives untouched.
Limitations — read this before you rely on it
This is a well-formedness checker and formatter, not a validating parser: it does not check against a DTD or XSD, does not resolve external entities (by design, for safety), and namespaces are treated as plain names. Documents with multiple roots are rejected, as the XML standard requires.
Frequently asked questions
Most often: mismatched tags (<a><b></a>), unclosed tags, multiple root elements, unquoted attribute values, or a stray < in text (use < or CDATA).
A section <![CDATA[…]]> whose contents are taken literally — < and & inside it need no escaping. Useful for code samples and comparisons.
Format is for humans reading structure. Minify is for transport and storage — same data, no whitespace.
Yes — comments and processing instructions are kept in place when formatting.
No. It checks well-formedness (structure) only, not whether your elements match a DTD or XSD.
