Input
1
Validation Result
Paste XML on the left — validation runs automatically.

What is XML Validation?

XML validation checks whether an XML document is well-formed — meaning it follows the strict syntactic rules of XML: every element must have a closing tag, attribute values must be quoted, tags must be properly nested, and there must be exactly one root element. This free online XML validator highlights the exact line of any syntax error, making it fast to find and fix malformed XML. Everything runs in your browser — no data is sent to any server.

Common XML Syntax Errors

  • Unclosed tags — every <tag> needs a matching </tag> or must be self-closed: <tag/>
  • Unquoted attribute values<item id=1> is invalid; use <item id="1">
  • Improper nesting<a><b></a></b> is invalid; elements must close in reverse order
  • Bare & in text — use &amp; instead of bare & in text content
  • Multiple root elements — a well-formed XML document must have exactly one root element
  • Invalid characters in tag names — tag names cannot start with a number or contain spaces

Once your XML is valid, use the XML Formatter to beautify it, the XML Minifier to compress it, or the XPath Tester to query it.

Frequently Asked Questions

What makes XML invalid?

Common causes: unclosed tags, unquoted attribute values, improperly nested elements, bare & or < characters in text, multiple root elements, or illegal characters in tag names.

What is well-formed XML?

Well-formed XML follows the syntactic rules of XML 1.0: one root element, all tags closed, attribute values quoted, proper nesting, and special characters escaped. This is different from valid XML, which also conforms to a DTD or XML Schema.

Is my data safe?

Yes. All validation runs entirely in your browser using the browser's built-in DOMParser. No data is ever sent to a server.

What is XML lint?

XML lint is just another term for XML validation — checking your XML for syntax errors. The term comes from the general practice of using "lint" tools to statically check code or data.