XML Validator
Check XML for well-formed syntax in your browser.
Your result will appear here…
How to use XML Validator
- Paste an XML document.
- Select Validate.
- Fix the first problem the parser reports, then validate again.
Example
Input / settings:
<message><status>ok</status></message>
Output:
Valid XML ✓
A well-formed document passes even when it would not match any schema.
When to use
- Check an XML response or configuration file before you send it on.
- Find a mismatched or unclosed tag in a long document.
- Confirm that every namespace prefix in a document is declared.
Overview
XML Validator checks whether text is well-formed XML by handing it to your browser's XML parser. It shows Valid XML ✓ or the parser's error; in Chrome the error includes a line and column. It checks syntax only. It does not validate against a DTD or an XSD schema, and it does not follow schema references.
Supported input
XML text
Output details
validation result
Limitations
- Checks XML well-formedness only. DTD and XSD validation is not performed and schema references are not followed.
- Error wording and positions come from the browser's XML parser and differ between browsers.
Common mistakes
- HTML is usually not XML. <br> alone is reported because the tag is never closed, and fails because XML defines no such entity. Write <br/> and   instead.
- Tag names are case-sensitive. <A></a> is reported as a mismatch between A and a.
- The XML declaration must be the very first thing in the text. A newline or a space before <?xml version="1.0"?> is an error.
- A bare ampersand is not allowed in text. Write Tom & Jerry, not Tom & Jerry.
- A document has exactly one root element. <a/><b/> and <a/>text are both rejected.
Practical tips
- Chrome reports the first error it finds. Fix it, validate again, and later messages often disappear.
- Once the document is valid, XML Formatter can re-indent it for reading.
Privacy and security
This tool runs entirely in your browser. Your input is never uploaded to our servers. Validation runs in your browser with the built-in XML parser and nothing is uploaded. The check accepts a DOCTYPE with an internal entity definition and does not warn about DTD or entity features, so review untrusted XML with a security-focused parser before you process it elsewhere.
References
Frequently asked questions
Does XML Validator check an XSD or DTD?
No. A schema reference such as xsi:noNamespaceSchemaLocation is accepted as an ordinary attribute and is not used to validate the document.
Why do the error messages differ between browsers?
They come from each browser's own XML parser. The line and column wording seen in Chrome is not guaranteed elsewhere.
How does XML Validator treat namespace prefixes?
A declared prefix is accepted. An undeclared prefix such as <x:a/> is reported as an error.