How to validate XML against an XSD
- Open the validator and paste your XML, drop a file or fetch it by URL. A folder or .zip of up to 1,000 documents works too.
- Expand Validate against a schema and add the .xsd: paste it, upload it (with the files it includes) or fetch it by URL. Or pick an official schema on the Catalog tab.
- Press Validate. Errors appear while the file streams through; click one to jump to its line.
Schemas with imports and includes
Real schemas are rarely one file. When yours uses xs:include, xs:import or xs:redefine, choose all of its files at once on the Upload tab, or the whole folder when it refers to other folders (../common/types.xsd). The layout is kept, so relative paths resolve as they do on disk, and the entry point is marked main.
Nothing is downloaded behind your back: a schemaLocation pointing at an http(s) URL is not fetched, so add that file alongside the others. The catalog has UBL, ISO 20022, HL7 CDA and other official schemas with every include already in place.
What is checked
Validation runs on libxml2, the library behind xmllint, PHP and many backends, compiled to WebAssembly, so the result matches what your server sees. It covers W3C XML Schema 1.0: complex and simple types, facets, substitution groups, xs:key/xs:keyref/xs:unique and xs:redefine.
XSD 1.1 features (assertions, conditional type assignment) are not supported. Business rules that go beyond a schema, such as the EN 16931 rules for e-invoices, are written in Schematron: see the Schematron validator.
Common XSD errors
Each of these links to an explanation of what it means and how to fix it:
- This element is not expected
- Missing child element(s)
- Is not a valid value of the atomic type
- [facet 'enumeration'] The value is not an element of the set
- No matching global declaration available for the validation root
In CI and from code
The same check runs from the command line and GitHub Actions and through the REST API:
npx @xmlvalid/cli validate "invoices/**/*.xml" --schema-file schema/invoice.xsd
From the catalog
Official schemas with all their files in place. Open one to see what it checks, or validate against it straight away.
- UBL 2.1 Invoice: The Universal Business Language invoice: the syntax behind Peppol BIS Billing 3.0 and one of the two syntaxes of the European e-invoicing standard EN 16931.
- UBL 2.1 Credit Note: The UBL credit note, used alongside the UBL invoice in Peppol BIS Billing 3.0 and EN 16931.
- UBL 2.5 Invoice: The UBL invoice in its latest version, 2.5 (August 2026), the version Spain's public e-invoicing solution checks against.
- UBL 2.5 Credit Note: The UBL credit note in version 2.5 (August 2026), backward compatible with UBL 2.1.
- UN/CEFACT Cross Industry Invoice D16B: The CII syntax of EN 16931: the XML inside Factur-X and ZUGFeRD PDFs and the CII flavour of XRechnung.
- UN/CEFACT Cross Industry Invoice D22B: The D22B release of the CII schema, the syntax the French e-invoicing reform names for CII invoices, with uncoupled code lists.
- Facturae 3.2.2: The Spanish e-invoice format, required for invoices to the public sector through FACe.
- Spain B2B e-invoice (SPFE, UBL 2.5): A Spanish B2B e-invoice in the format of the AEAT's public e-invoicing solution (SPFE), checked against the UBL 2.5 schema the AEAT validates with.
- VERI*FACTU invoice records: The invoice records a Spanish invoicing system sends to the AEAT under VERI*FACTU: one record per invoice issued (alta) or cancelled (anulación), chained by their SHA-256 fingerprints.
- KSeF FA(3): The structured invoice of the Polish National e-Invoicing System (KSeF), in the FA(3) version required from February 2026.
- CFDI 4.0: The Mexican electronic invoice, with the Timbre Fiscal Digital stamp and the Pagos 2.0 payment complement.
- NF-e 4.00: The Brazilian electronic invoice for goods (model 55), in the layout of schema package PL_010f.
- ISDOC 6.0.2: The Czech format for electronic invoices, read by most Czech accounting software.
- Finvoice 3.0: The Finnish banks' e-invoice format, sent between companies and to consumers' online banks.
- UBL 2.1 Debit Note: A UBL document that charges a buyer an additional amount after an invoice.
- UBL 2.1 Order: A purchase order in UBL 2.1, the syntax of Peppol ordering and many e-procurement platforms.
- UBL 2.1 Order Response: The seller's answer to a UBL order: accepted, rejected or accepted with changes.
- UBL 2.1 Order Change: A buyer's change to an order that was already sent.
- UBL 2.1 Order Cancellation: A buyer cancels an order it sent earlier.
- UBL 2.1 Despatch Advice: A delivery note in UBL 2.1: what was shipped, in which packages, and when it should arrive.
- UBL 2.1 Receipt Advice: The receiver confirms what arrived, including short or rejected quantities.
- UBL 2.1 Catalogue: A product catalogue in UBL 2.1: items, prices and properties a seller offers a buyer.
- UBL 2.1 Application Response: A generic UBL response to another document: received, accepted, rejected, with reasons.
- UBL 2.1 Quotation: A seller's quotation in answer to a request for quotation.
- ISO 20022 pain.001.001.09: A company asks its bank to make one or more credit transfers. The message behind SEPA payment files.
- ISO 20022 pain.002.001.10: The bank's answer to a payment file: which transfers or direct debits were accepted and which were rejected, with a reason code.
- ISO 20022 pain.008.001.08: A creditor asks its bank to collect direct debits. The message behind SEPA Core and B2B direct debit files.
- ISO 20022 pacs.008.001.08: A customer credit transfer between banks, the message that replaces SWIFT MT103.
- ISO 20022 camt.052.001.08: An intraday account report from a bank, the XML successor of MT942.
- ISO 20022 camt.053.001.08: An end-of-day account statement from a bank, the XML successor of MT940.
- ISO 20022 camt.054.001.08: A notification of individual debits and credits on an account, the XML successor of MT900 and MT910.
- ISO 20022 pain.001.001.03: The 2009 version of the payment initiation message, still produced by many ERP systems and accepted by many banks.
- ISO 20022 pain.008.001.02: The 2009 version of the direct debit initiation message, the SEPA direct debit format until 2023.
- ISO 20022 pain.002.001.03: The status report that answers pain.001.001.03 and pain.008.001.02 files.
- ISO 20022 camt.053.001.02: The 2009 version of the end-of-day bank statement, the one many banks still deliver.
- ISO 20022 pacs.002.001.10: A bank reports to another bank whether a payment instruction was accepted, settled or rejected.
- ISO 20022 pacs.009.001.08: A credit transfer between banks for their own account, the message that replaces SWIFT MT202.
- ISO 20022 pacs.004.001.09: A bank sends the funds of a settled payment back, with a return reason.
- ISO 20022 camt.056.001.08: A bank asks another bank to cancel a payment it sent, the message that replaces MT192 and MT292.
- ISO 20022 camt.029.001.09: The answer to a cancellation request or another investigation, the message that replaces MT196 and MT296.
- ISO 20022 pain.013.001.07: A request to pay: the payee asks the payer to start a credit transfer.
- ISO 20022 pain.014.001.07: The answer to a request to pay: accepted, rejected or pending.
- JPK_V7M(3): The monthly Polish VAT return combined with the sales and purchase records (JPK_VAT with declaration).
- JPK_FA(4): The Polish audit file of issued invoices, sent on request of the tax authority.
- SAF-T Financial NO 1.40: The Norwegian standard audit file of a company's accounts: general ledger, customers, suppliers and transactions.
- HL7 CDA Release 2: The base schema of clinical documents such as discharge summaries, referrals and C-CDA documents.
- HL7 FHIR R4: Any FHIR R4 resource in its XML form: Patient, Observation, Bundle and the other 140-odd resource types.
- Sitemap 0.9: The sitemap.xml format read by Google, Bing and other search engines.
- Sitemap index 0.9: An index that points search engines at several sitemap files.
- Sitemap with Google extensions: A sitemap.xml that also lists images, videos or news articles with Google's sitemap extensions.
- GPX 1.1: Waypoints, routes and tracks exported by GPS devices, sports watches and mapping apps.
- OGC KML 2.2: Placemarks, paths and polygons for Google Earth and other map viewers.
- TCX v2: Workout files from sports watches and fitness apps: laps, track points, heart rate and cadence.
- Maven POM 4.0.0: The pom.xml of Maven projects: dependencies, build plugins, modules.
- SOAP 1.1 Envelope: The envelope, header, body and fault of SOAP 1.1 messages.
- SOAP 1.2 Envelope: The envelope, header, body and fault of SOAP 1.2 messages.
- Jakarta EE web.xml 6.0: The web.xml of Java web applications on Jakarta EE 10 servers: servlets, filters, mappings, security.
- Jakarta Persistence 3.0: The persistence.xml of JPA applications (Hibernate, EclipseLink) on the jakarta.persistence namespace.
- Maven settings 1.2.0: The Maven settings.xml in ~/.m2 or on a CI runner: servers, mirrors, proxies and profiles.
- Liquibase changelog 4.33: Liquibase database changelogs in XML: change sets, tables, columns, constraints, rollbacks.
- WSDL 1.1: Web service descriptions for SOAP services: types, messages, port types, bindings and services.
- SAML 2.0: SAML 2.0 single sign-on messages: authentication requests, responses with assertions, logout.
- XML Signature: The structure of an XML digital signature: SignedInfo, references, digests and key information.
- XSLT 2.0: XSLT 2.0 stylesheets checked against the W3C schema for XSLT: elements, attributes and where they may appear.
- XML Schema 1.0: Check an .xsd file itself against the W3C schema for schemas.
- JUnit XML report: The JUnit XML test report that CI systems read (Jenkins, GitLab, GitHub Actions reporters).
- XLIFF 1.2: Translation files exchanged with translators and CAT tools, as used by Xcode, Angular and Symfony.
- XLIFF 2.0: XLIFF 2.0 translation files: units, segments and inline codes.
- ONIX for Books 3.1: Book metadata feeds from publishers to retailers, libraries and aggregators, in ONIX 3.1 with reference tag names.
- ONIX for Books 3.1 short tags: ONIX 3.1 book metadata with short tag names (b001, x507 …).
- ONIX for Books 3.0: ONIX 3.0 book metadata with reference tag names, the version most trading partners still take.
- ONIX for Books 3.0 short tags: ONIX 3.0 book metadata with short tag names.
- MARCXML: MARC 21 bibliographic, authority and holdings records in XML, as exported by library systems.
- MODS 3.8: Bibliographic descriptions in MODS, used by digital libraries and repositories.
- METS 1.12: Packages of digitised objects: files, structure maps and the metadata that goes with them.
- EAD3: Archival finding aids: the description of a collection, its series and its files.
Questions
Is my XML uploaded?
No. In the browser the document and the schema are read from your disk and validated on your machine with WebAssembly. Only the API and URL monitors validate on our servers.
How large can the file be?
Up to 50 MB without an account and 1 GB with a free one. The validator streams the document, so memory use stays flat whatever its size.
Does it support XSD 1.1?
No. It validates W3C XML Schema 1.0, which is what most published schemas (UBL, ISO 20022, HL7 CDA) are written in. Assertions and other XSD 1.1 features are not checked; when a schema uses them, the result says so and shows where.
Can I use a schema from a URL?
Yes: the schema panel has a URL tab. Files the schema imports by http(s) URL are not fetched; upload them with the schema instead.
Other schema languages
- DTD validator (Document Type Definition)
- RelaxNG validator (RelaxNG)
- Schematron validator for e-invoices (Schematron)