Real DOMParser validation

XML Formatter & Validator — Free Online

Paste XML to validate it with a real parser and pretty-print it with clean indentation — parse errors reported with their exact location.

Genuine validation

Parsing uses the browser's real XML engine — the same strictness as production parsers. If it validates here, it parses anywhere well-formed XML is expected.

Watch the ampersand

A bare & in text is the #1 XML error — it must be &. URLs with query strings inside XML need every & escaped, or wrap the content in CDATA.

Formatting is lossless

Only inter-element whitespace changes. Text, attributes, comments and CDATA sections come through byte-identical.

How to use the XML formatter

  1. Paste your XML

    Raw, minified or hand-written — any well-formedness level.

  2. Format & validate

    The parser checks validity first; errors are reported with their exact location.

  3. Review the tree

    Valid XML is reprinted with 2-space indentation so structure is obvious at a glance.

  4. Copy it out

    One click copies the formatted XML for your editor, config or codebase.

Your input is processed in your browser and is not stored by us.

Frequently asked questions

Related tools

Need a custom tool?

We build calculators and internal tools for businesses — get in touch.

Directory last updated 2 December 2026.

Disclaimer: your input is processed in your browser and is not stored by us. Validation covers well-formedness, not schema (XSD/DTD) conformance.