XML Validator
Validate XML online and identify malformed tags, attributes, nesting, or document structure without changing the original input. Read more
Validate XML syntax online
This XML validator checks whether the input is a well-formed XML document. It reports parsing errors caused by problems such as mismatched tags, invalid nesting, unquoted attribute values, or malformed entity references.
This is a well-formedness check, not validation against a DTD or XML Schema. A document can pass here while still missing elements, attributes, namespaces, or values required by the system that consumes it.
How to check an XML document
- Paste the complete XML into the input editor.
- Click Validate.
- If parsing fails, inspect the reported line, column, and nearby tag.
- Correct the document and repeat until the result is Valid.
When tracking down an error, remember that a parser may only discover it after reaching a later closing tag. The actual mistake can therefore appear earlier than the reported location.
Common XML errors
- More than one top-level document element
- A start tag and end tag with different names or capitalization
- An element closed in the wrong nesting order
- An unescaped
&or<in text - An attribute without a quoted value
- A namespace prefix that has not been declared
The W3C XML specification defines the well-formedness requirements used by XML processors.
XML validator FAQ
Does Valid mean the XML matches my schema?
No. This result means the browser’s XML parser accepted the document as well formed. Schema validation is a separate step that checks an external vocabulary and constraints.
Why does HTML work in a browser but fail here?
HTML parsers can recover from missing tags and other errors. XML requires well-formed syntax and is case-sensitive, so the same markup may not be valid XML.
Can the tool correct invalid XML automatically?
No. Automatic repair can guess the wrong intended structure. Correct the reported source, then use the XML Formatter when you want consistent indentation.