Free developer & data tool

XML Formatter & Validator

Check XML well-formedness and serialize it conservatively with browser DOM APIs.

This tool processes input locally in your browser without a tool API upload. This describes tool processing, not a site-wide logging guarantee. Avoid pasting live secrets.

Output

Supported behavior

  • Check XML well-formedness and serialize it conservatively with browser DOM APIs.
  • DOCTYPE and ENTITY declarations are rejected before parsing, preventing DTD/entity processing. Attributes and namespaces are parsed, not schema-validated. Mixed content, whitespace, CDATA and xml:space elements are kept intact rather than aggressively indented. Formatting can add whitespace between element-only children; do not use for byte-exact signatures. DOM serialization can normalize lexical details. Input limit: 200,000 characters per text input; regex and diff have additional limits described above.

How to use the XML Formatter & Validator

  1. Paste XML without DTD declarations; review parser errors or copy the serialized output.
  2. Review the result or error before copying. Shared output panels offer Copy; there is no file upload or download workflow.
  3. Tool input is processed locally without a tool API request. This does not establish site-wide analytics or logging policy.

Examples

Worked behavior

<root><item id="1">A &amp; B</item></root> retains its escaped text; <p>Hello <b>world</b>!</p> retains mixed-content spacing.

Limits and common mistakes

DOCTYPE and ENTITY declarations are rejected before parsing, preventing DTD/entity processing. Attributes and namespaces are parsed, not schema-validated. Mixed content, whitespace, CDATA and xml:space elements are kept intact rather than aggressively indented. Formatting can add whitespace between element-only children; do not use for byte-exact signatures. DOM serialization can normalize lexical details. Input limit: 200,000 characters per text input; regex and diff have additional limits described above.

Frequently asked questions

Will this validate an XSD or fetch an external entity?

No. There is no schema validator or external fetch path. Use XML without a DTD; parser error wording depends on browser.

Sources & methodology

Related tools

More developer & data tools