Validate XML syntax and structure. Check for well-formedness errors, mismatched tags, unclosed elements, and invalid characters in your XML documents.
XML validation checks whether a document is "well-formed" — meaning it follows the basic syntax rules of XML. A well-formed XML document must have a single root element, properly nested and closed tags, quoted attribute values, and no invalid characters. Validation catches errors that would cause XML parsers to fail.
Valid XML = Single root + Proper nesting + All tags closed + Quoted attributes + Valid charactersWell-formedness rules require: exactly one root element containing all others, every start tag has a matching end tag, elements are properly nested (no overlapping), attribute values are enclosed in quotes, special characters are properly escaped, and no duplicate attribute names on the same element.
| Input | Output |
|---|---|
| <root><item>Hello</item></root> | ✓ Valid XML — Well-formed document with 1 root element and 1 child element |
| <root><item>Hello</root> | ✗ Invalid XML — Unclosed tag "item" at line 1, column 7 |
| <root><item>Hello</item></root><extra/> | ✗ Invalid XML — Multiple root elements found at line 1 |