Bee Hive
XML Validator
Check if your XML is well-formed.
About XML Validator
Frequently Asked Questions
What does "well-formed" mean?
It means the XML adheres to the syntax rules, like having a single root element, properly nested tags, and quoted attributes.
Does this validate against a schema (XSD)?
No, this tool only checks for syntax errors (well-formedness), not schema compliance.
Is my XML data secure?
Yes, the validation is performed entirely within your browser using the DOMParser API.
What is XML used for?
XML is widely used for configuration files, data exchange between systems, web services (SOAP), RSS feeds, SVG graphics, office document formats (DOCX, XLSX), and as a general-purpose data serialization format.
What's the difference between well-formed and valid XML?
Well-formed XML follows the basic syntax rules and can be parsed successfully. Valid XML not only is well-formed but also conforms to a specific schema (XSD or DTD) that defines the allowed structure and data types.
Why am I getting parsing errors?
Common causes include unclosed tags, missing the XML declaration, special characters that aren't properly escaped (like &, <, >), attributes without quotes, or multiple root elements. Check the error message for the specific line number.
Do I need an XML declaration?
The XML declaration (<?xml version='1.0'?>) is recommended but not mandatory for well-formedness. However, it's best practice to include it, especially when specifying character encoding.
How do I handle special characters in XML?
Special characters must be escaped: & becomes &, < becomes <, > becomes >, " becomes ", and ' becomes '. Alternatively, you can use CDATA sections for blocks of text containing special characters.
Can this tool validate XHTML or SVG?
Yes, as long as they are well-formed XML documents. XHTML and SVG are XML-based formats, so this tool can check their syntax. However, it won't validate against XHTML or SVG-specific schemas.
What's the difference between XML and HTML?
XML is stricter and more rigid: all tags must be closed, attribute values must be quoted, and it's case-sensitive. HTML (especially HTML5) is more forgiving and allows unclosed tags and unquoted attributes in many cases.