Developer Tools

Formatters & Validators

XML Formatter / Validator

Pretty-print and well-formedness check for XML.

XML0 chars
XML rapi

Guide & explanation

The XML Formatter / Validator re-indents an XML document and checks it for well-formedness.

Well-formed versus valid

An XML document is well-formed when it respects the XML syntax: every start tag has a matching end tag, elements nest properly, attribute values are quoted, and special characters such as < and & are escaped. This tool checks well-formedness and reports the line and column of any problem.

A document is valid when it goes further and conforms to a schema (XSD or DTD) — the allowed element names, their order, and data types. Schema validation is not performed here.

Example

<order><item>Coffee</item><qty>2</order>

Not well-formed: <qty> is never closed and <item> is closed by the wrong tag. The correct form:

<order>
  <item>Coffee</item>
  <qty>2</qty>
</order>

Reading the results

LevelMeaning
XML well-formedThe structure is balanced; the panel shows the element count.
Structure issuesA list of line:column problems: a tag that is never closed, or a closing tag with no opener.

The <?xml ?> declaration, comments, CDATA, and processing instructions are preserved as-is.