XML

XML Validator

Check XML well-formedness and get the precise line and column of the first error.

Private by design — your data never leaves your device.
✓ Free forever✓ No sign-up✓ No ads✓ Works offline once loaded

XML Validator

Check XML well-formedness and get the precise line and column of the first error.

Input

XML to check

Nothing is uploaded.

Output

Validation result

Your result appears herePaste on the left and select “Validate XML”

A well-formedness error stops every XML parser in the chain before your application logic runs, so finding the offending character quickly is usually the whole job. This validator reports the specific fault and its exact line and column, rather than the generic "parse error" that most tools surface.

When the document is valid you also get a structural summary — root element, element and attribute counts, and how many namespaces are declared — which is a fast way to sanity-check that a payload contains what you expect.

How it works

How to use the xml validator

  1. 1

    Paste the XML

    Paste or upload the document. Nothing is sent anywhere; the parser runs locally.

  2. 2

    Read the result

    A valid document reports its root element and structure counts. An invalid one reports the first fault with its line and column so you can jump straight to it.

  3. 3

    Fix and re-check

    Edit directly in the input pane and validate again. XML parsing stops at the first error, so a document can surface several problems in sequence.

The five errors that account for most failures

  • Mismatched tags. An element closes with a different name, or elements overlap instead of nesting: <a><b></a></b>.
  • Unescaped characters. A bare & or < in text content. Both must be written as entities (&amp;, &lt;) or wrapped in CDATA.
  • Unquoted attribute values. XML, unlike HTML, requires quotes on every attribute value without exception.
  • Multiple root elements. Two top-level elements with no single containing root. Common when concatenating fragments or logging several messages into one file.
  • Undeclared namespace prefixes. Using ns1:element without a corresponding xmlns:ns1 declaration in scope.

What this validator does not do

It does not check your document against an XSD, DTD, RELAX NG schema or Schematron ruleset. Those describe which elements are permitted where, what data types values must have, and which combinations are required — questions that can only be answered with the schema in hand.

A document can be perfectly well-formed and still be rejected by the service you are sending it to, because it violates that service's schema. Well-formedness is the floor, not the ceiling.

Common questions

XML Validator FAQ

What does "well-formed" mean exactly?

It means the document obeys XML 1.0 syntax rules: one root element, correctly nested and matched tags, quoted attribute values, properly escaped reserved characters, and valid character encoding. Any conforming XML parser will accept a well-formed document.

Why does it only report one error at a time?

XML parsing is sequential and halts at the first fault, because everything after an unclosed tag is ambiguous. Fix the reported error and validate again to reveal the next one.

Can I validate against my own XSD?

Not yet. Schema validation is planned. Today the tool checks well-formedness only, and says so rather than implying more.

Is the document stored or logged?

No. It never leaves your browser. There is no server-side component to store anything in.