Validate XML

Paste, upload or fetch by URL. Optionally check the document against an XSD, DTD or RelaxNG schema, against a catalog profile with its Schematron business rules, or against your own Schematron rules. Documents are validated on your machine and never uploaded

XML document

Checking PDF/A with veraPDF…
· ·

The file is downloaded through our server, which doesn't keep it, and validated in your browser. Public http(s) addresses only

·
When the schema includes files from subfolders: their layout is kept

The document is validated against the DTD declared in its own <!DOCTYPE>. Only an internal subset is available in the browser: external DTD files can't be fetched from here; upload them on the Upload tab instead

· · About this schema

Official schemas with their include files. Browse the catalog

When the rules include files from subfolders
compiling ready failed

The browser can run Schematron but not compile it, so the .sch file and the files it includes are uploaded, compiled on our server and kept for a week; documents are never sent. The rules then run here, on documents that pass the schema check or, without a schema, are well-formed. XPath 2.0 and 3.0 (query binding xslt2 or xslt3) are supported; choose the files a schema includes along with it

Validated in your browser · ⌘ ↵ … Validating in your browser… Cancelled Something went wrong
/ ·

Couldn't validate

Create a free account →

Files up to 50 MB without an account, up to 1 GB with a free account. Up to 1,000 errors are listed; all of them are counted.

Questions

Validating XML online

What the validator checks, with a schema and without one

How do I validate an XML file online?

Drop the file above, paste the XML or fetch it by URL, pick a schema and press Validate. Every problem is listed with its line and column, and a click takes you to it in the editor. Without a schema, the validator checks that the document is well-formed.

Can I check XML syntax without a schema?

Yes. Leave the schema empty and the validator works as an XML checker: one root element, every tag closed and nested in order, attribute values quoted, no attribute twice, entities declared, characters allowed in XML and in the declared encoding. It reports every syntax error it finds, not just the first one.

What is the difference between well-formed and valid XML?

Well-formed XML follows the syntax rules of XML 1.0, so any parser can read it. Valid XML is well-formed and also matches a schema: the elements and attributes it may contain, their order, how often they occur and the form of their values. A document can be well-formed and still invalid, for example an order without the customer element its XSD requires.

Which schema languages does it support?

XML Schema (XSD 1.0) with imports and includes, DTD (an external file or the DOCTYPE in the document), RelaxNG in the XML and the compact syntax, and Schematron, the business rules of e-invoicing formats or your own .sch file. XSD 1.1 is not supported: the validator names the 1.1 constructs it finds in a schema.

Can I validate against an XSD that imports or includes other files?

Yes. Add the main schema with the files it imports or includes, or the folder that holds them, which keeps its layout, so relative paths resolve as on disk. The schema catalog has official schema sets ready to use, such as UBL, ISO 20022 and HL7 CDA.

Is my XML uploaded?

No. The validator runs in your browser as WebAssembly, so files you open or paste never leave your computer. A document fetched by URL passes through our server on its way to your browser and is validated there too.

How large an XML file can I validate?

Up to 50 MB without an account and up to 1 GB with a free one. The document is streamed through the parser, so memory stays flat and a 1 GB file takes about ten seconds.

Can I validate many XML files at once?

Yes. Open several files, a folder or a .zip of up to 1,000 documents; each one is checked against the schema you picked, or, for e-invoices, against the profile it names. For files in a build or a script, the command-line client and API do the same.

What does "This element is not expected" mean?

The document has an element where the schema allows a different one, or none: a wrong order, a misspelled name, a missing namespace or a required element left out before it. The message names the elements the schema expected. Its page in the error guide goes through the causes and the fix, and XML error messages covers the other common ones.

Is the XML validator free?

Yes. Validation in the browser is free, with no limit on the number of documents. The API and the command-line client run on our servers, with a free monthly allowance; Pro raises it and adds URL monitors.