XML

XML Validator — Well-Formedness Check

Checks that XML is well-formed — every tag closed, closed in the right order, one root — and names the line and column of the first failure.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste the document you want checked.
  2. Select Check.
  3. If it fails, go to the reported line and column — with a missing close tag the report points at the tag that could not be matched, which is usually after the real mistake.
  4. Fix the first problem and check again. One error often hides several.

What xml validator does

XML has two different notions of correct, and confusing them wastes a lot of time. A document is well-formed when it obeys the syntax: one root element, every tag closed, tags closed in the order they were opened, attribute values quoted, and no bare ampersand or angle bracket in text. A document is valid when, on top of that, it matches a specific DTD or XSD — the right elements, in the right order, with the right types.

This tool checks the first of those. It is what you want when a parser has rejected a file outright and you need to know where, because a well-formedness error stops parsing dead and nothing downstream will run. Checking a document against a schema is a separate job and this tool does not do it, so a file that passes here can still be rejected by a system that holds it to an XSD.

Frequently asked questions

Well-formed means the document obeys XML syntax: one root, every tag closed in the right order, attribute values quoted, no bare ampersands. Valid means it also matches a specific DTD or XSD. This tool checks the first. A document can pass here and still be rejected by a system that holds it to a schema.

No. Schema validation needs the schema, and often the other schemas that one imports, so it is a different job from a syntax check. This tool deliberately does not claim to do it.

A missing close tag is only detectable when something else closes in its place, so the reported position is where the contradiction appeared rather than where the tag should have been. Read the message: it names both tags, and the one it expected is the one you left open.