Validate XML

Paste XML to validate well-formedness in this tab. The status bar shows the first syntax error with its exact line and column, or a green well-formed result with line and byte counts. This XML validator does not fetch DTDs or apply an XSD. SOAP, SAML and invoice documents stay on this device.

Input
Output
Well-formed XML9 lines261 BValidated on this device

Runs in this tab · nothing is uploaded · Verify in 10 seconds →

What this does

Validation checks well-formedness only: one root, matching tags, quoted attributes and escaped & < >. The status bar reports the first error's exact line and column, or a green well-formed result with line and byte counts. It is not an XSD or DTD schema validator, and it never fetches an external DTD.

A well-formedness checker reports exactly one error per run, the first place the parser gave up, because after a mismatched tag the rest of the document is unparseable. Four mistakes cause nearly all failures: an unclosed tag, a raw & (use &amp;), mismatched case (<Book> vs </book>), and a second root element.

When it goes wrong

When the status bar shows “Line 12, column 3” look at that position and one tag backwards: validators report where they stopped, which is often the closing tag that did not match. An error at line 1, column 1 on a document that looks fine is usually a UTF-8 BOM or a smart quote pasted from email. External entity and DTD URLs are never fetched, so an XXE-style SYSTEM identifier cannot load anything.

When to use this

Validate when a SOAP client, SAML IdP, Maven or an e-invoice gateway rejects a payload with “not well-formed”, and before you minify or convert the same document to JSON.

This page is a focused view of theXML Formatter, Validator & Pretty Print, which has the full set of options.

Frequently asked questions

Does this upload my XML?

No. Well-formedness is checked in this tab. There is no endpoint that receives the document.

How do I validate XML and find the error?

Paste the document. The status bar shows the first well-formedness error with line and column, and the gutter highlights that line.

Is this an XSD or DTD schema validator?

No. It answers “is this well-formed XML?”, not “does it match my schema?”. External DTDs are never fetched.

What does “not well-formed” usually mean?

An unclosed tag, a raw ampersand, mismatched element case, or more than one root element. Fix the first reported position and validate again.

Is it safe to paste SOAP or SAML XML?

The document never leaves the device, and external entities are not resolved, so XXE-style payloads cannot fetch anything.

Does validation change my XML?

No. Checking well-formedness does not rewrite the text. Format and Minify are separate actions.