XML Validator
Paste XML and instantly see if it's well-formed. Errors show the exact line and column. Valid XML displays the root element name, child count, total elements, and byte size.
Last updated: May 21, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is XML Validator?
XML (eXtensible Markup Language) is strict about its syntax — every opening tag must have a matching closing tag, attributes must be quoted, special characters must be escaped, and there can only be one root element. A document that follows these rules is called "well-formed". Parsers reject any XML that is not well-formed with a parse error.
This validator uses the browser's built-in XML parser (DOMParser) to check your XML. If parsing fails, the parser reports a parsererror element with the problem description and location. The validator extracts the line and column number so you can jump directly to the issue. For valid XML, it displays the root element tag name, the number of direct children, the total element count in the entire document, and the byte size.
How to Use XML Validator
Paste XML into the input area or click "Valid Sample" or "Invalid Sample"
The validator runs instantly
A green badge means the XML is well-formed; red means invalid
If invalid, the exact line and column of the error is shown
Fix the issue and re-validate
Common Use Cases
- Developers validating XML API request or response payloads before processing.
- Engineers checking XML configuration files before deployment.
- Teams validating SOAP envelopes before sending to web services.
- Data engineers verifying XML data files before importing into databases.
- Developers debugging XML parse errors from application logs.
- Architects validating XML schemas and instance documents during design.
Example Input and Output
An XML document with a missing closing tag fails validation with the exact error location.
<products>
<product>
<name>Widget A</name>
<price>9.99
</product>
</products>✗ Invalid XML
Error at line 5: expected </price> closing tag
Fix: add </price> after the value 9.99Privacy
All validation runs in your browser via DOMParser. No data is uploaded to any server.
HTML vs XML parsing
HTML is not XML — browsers parse HTML leniently and fix errors silently. This validator uses strict XML parsing (application/xml), not HTML parsing, so valid HTML may fail here if it uses HTML-specific features like void elements without self-closing slashes.

