XML Schema Validator
Check an XML document against an XSD and see which element breaks which rule.
This one runs on the server. Validating against XML Schema is not something a browser can do, so your document and your schema are sent here to be checked, and then dropped. They are not stored, not logged, and never put in a URL. If the document is confidential, run xmllint locally instead — it is the same engine.
Paste a document and the XSD it is supposed to satisfy. You get the verdict, and for every rule it breaks the element, the line and the constraint — not just the word "invalid".
How it works
Three things can go wrong and they are reported separately, because they mean different things. The document may not be well-formed XML, in which case nothing was checked. The schema may not be a usable XSD, in which case nothing was checked either. Or both were read and the document broke a rule — which is the only case where "invalid" tells you about your data.
The validation is libxml's, the same engine behind most XML tooling, so the answer agrees with what your build will say. Its diagnostics are shown as they come, in English, because they name the element and the constraint and a paraphrase would be a guess at what a message we did not write meant.
This tool runs on the server, and it is the only one here that does. No browser can validate against XML Schema; there is no API for it. Your document and schema are sent, checked and discarded — never written to disk, never logged, and never put in a URL.
Two things are refused outright. A document or schema declaring a DTD or an entity, because a DTD can instruct a parser to read files from the server. And a schema that imports or includes another file, because nothing is fetched here: only part of it could be applied, and a partial check reported as a pass is the worst answer a validator can give.
Examples
| Case | Input | Result |
|---|---|---|
| A value of the wrong type | <price>cheap</price> | Element 'price': 'cheap' is not a valid value of the atomic type 'xs:decimal'. |
| A required attribute left out | <book><title>V</title><price>1</price></book> | Element 'book': The attribute 'id' is required but missing. |
| A child element missing | <book id="b1"><title>V</title></book> | Element 'book': Missing child element(s). Expected is ( price ). |
Frequently asked questions
Does my document leave my browser?
Yes, and this is the only tool on the site where that is true. Validating against XML Schema is not something a browser can do, so the document and the schema are sent here, checked, and dropped. They are not stored, not logged and not put in any URL. If that is not acceptable for the document you have, validate it locally instead — xmllint does the same thing with the same engine.
Why was my schema refused for importing another one?
Because nothing is fetched from anywhere: no network, no filesystem. A schema split across files can only be half applied here, and a validator that checks half the rules and then says "valid" is giving an answer worse than no answer. Combine the files, or validate locally where the other file exists.
Why is a DOCTYPE refused?
Because a DTD can declare an entity pointing at a file on the server, and that is the oldest way there is to turn an XML parser into a file reader. Entity loading is switched off here as well, so refusing the construct is a second lock rather than the only one — but a document being checked against an XSD has no use for a DTD anyway.
Why are the error messages in English?
They come from libxml rather than from this site. They quote your element names and the constraint that failed, which is the part you need, and translating them would mean paraphrasing diagnostics we did not write — guessing wrong about one of those is more expensive than reading it in English.
Which version of XML Schema?
XSD 1.0, which is what libxml implements. XSD 1.1 assertions and conditional type assignment are not supported by it, so a 1.1 schema using them will be reported as unreadable rather than quietly checked without those rules.
My schema starts with encoding="utf-16" and it was refused. Why?
Because that declaration describes a file, and what reaches this page is what your browser posted, which is UTF-8. libxml believed the declaration and refused to read the schema at all. The encoding is now dropped whenever it does not say UTF-8, and the result says so. The same thing with encoding="ISO-8859-1" used to be worse, because it did not fail: every accented character was quietly mangled and the document was then validated against text nobody had written.
Good to know
- Runs on the server. Your document and schema are sent, checked and discarded — not stored, not logged, not shareable in a URL. Every other tool in this category runs in your browser; this one cannot, because no browser validates XML Schema.
- The verdict is libxml's, and so is the wording of every diagnostic. XSD 1.0 only.
- At most fifty problems are listed. A document that breaks a rule a thousand times usually breaks it for one reason.