Kadben

XML validator: check well-formedness

Choose an XML file or paste XML to find out whether it is well-formed. If it is not, you see the first error with its line, column and a marker in the text.

Runs in your browser. Nothing is uploaded.

XML validator

Input

The result appears here.

How to use it

  1. Choose an XML file, drop it on the box, or paste XML; the result appears at once.
  2. Read the result: “Well-formed XML” with a short summary, or the first error with its line and column.
  3. Fix the error at the marked position and check again until the document is well-formed.

Rules and limits

What is checked

Questions and answers

Does it validate against an XSD schema or a DTD?

No. A well-formed document can still break its schema. The validator reads a DOCTYPE and its internal entity declarations, but it does not check the document against the DTD.

Which errors are most common?

An unescaped & in text (write &amp;), a closing tag that does not match the open element, a second element after the root element has ended, and blank lines or spaces before the <?xml …?> declaration.

How are lines and columns counted?

Lines and columns start at 1. CRLF, LF and CR each end a line, and every character (Unicode code point) counts as one column. The position is where the problem was detected: for an element that is never closed, that is the end of the file, and the message names the line where the element was opened.

Related tools