Check that your XML is well formed, with the exact line and column of any problem.
Loading the tool...
How to use XML Validator
Paste your XML or upload a file.
A green bar means it is well formed. A red bar shows the problem and the line.
Click Go to error to jump to it.
About XML Validator
This validator checks well-formedness: the rules every XML document has to follow no matter what it describes. Tags must be closed and nested correctly, attribute values must be quoted, special characters must be escaped, and there is a single root element.
When something is wrong, the message tells you what the parser expected and where, for example "Expected closing tag 'item' (opened in line 4) instead of closing tag 'items'". That is usually all you need to find the typo.
Frequently asked questions
Does this validate against an XSD or DTD?
No, only well-formedness. Schema validation needs the schema file and a different kind of tool.
What are the most common XML errors?
A missing closing tag, tags closed in the wrong order, an unescaped ampersand in text (use &), unquoted attribute values and more than one root element.
Why does "&" cause an error?
The ampersand starts an entity reference in XML. A bare one is invalid, so write & when you mean the character itself.
Does the validator accept DOCTYPE declarations?
Yes, they are read and ignored. Entities defined in them are not expanded.