XML Well-Formed Validator
Verify XML is well-formed using the browser’s native parser, with error positions.
Check XML well-formedness instantly in your browser. Free XML validator with precise error positions — no uploads.
Calculator Inputs
About XML Check
Verify XML is well-formed using the browser’s native parser, with error positions.
Paste any XML document. The browser’s own parser — the same strict engine behind fetch and XHR — parses it, and any parsererror is surfaced with location details. Valid output names the root element and element count.
Well-formed means parseable, not correct: schema (XSD/DTD) conformance is a separate, deeper check. Everything runs in your browser.
Where it is used
Debugging feeds (RSS/sitemaps), validating config files, checking API payloads, and teaching XML rules.
How to use the XML Check
- XML Document — enter the value (e.g. <note><to>Ada</to></note>).
- Calculate — press the Calculate button to see the result instantly above.
Formula
Native DOMParser with application/xml; parsererror subtree means malformed.
Examples
Example
Frequently Asked Questions
- Well-formed vs valid?
- Well-formed follows XML syntax rules. Valid additionally conforms to a schema (XSD/DTD). This tool checks the former.
- Why do ampersands fail?
- Raw & starts an entity reference. Escape as & (or wrap code in CDATA) — the most common XML error by far.
- Single root required?
- Yes — XML documents have exactly one root element. Fragments with siblings need a wrapper.