What this XML formatter does

Paste XML to pretty-print it with proper indentation, minify it, or validate that it is well-formed. The formatter keeps CDATA sections and attributes intact and highlights the structure so you can find the element you need in a large document.

Well-formed is not the same as valid

This tool checks that the document is well-formed: tags balance, attributes are quoted, and there is exactly one root element. It does not validate against a schema (XSD or DTD), so a document can be perfectly well-formed and still not match the schema your application expects.

Frequently asked questions

What is the difference between well-formed and valid XML?

Well-formed means the syntax is correct: every tag is closed and nested properly. Valid means the document also conforms to a schema such as an XSD or DTD. This formatter checks well-formedness, which is what most day-to-day debugging needs.

Does it handle namespaces and CDATA?

Yes. Namespaced elements and attributes are preserved as written, and CDATA sections are kept intact rather than being escaped or reformatted.

Why does my XML fail to parse?

The most common causes are an unescaped ampersand (&) or angle bracket in text, mismatched tags, and multiple root elements. Escape stray ampersands as & and check that every opening tag has a matching close.

Is my XML uploaded?

No. Formatting and validation happen entirely in your browser, so configuration files and API payloads stay on your device.

Related tools