Standards
CII vs UBL: understanding the two XML formats behind e-invoicing
CII vs UBL: understanding the two XML formats behind e-invoicing
EN 16931 defines what a compliant European e-invoice must contain. It does not define the file format. The same invoice data can be serialized as CII XML or UBL XML, and both are valid EN 16931 documents. This post explains how the two syntaxes differ, where each one is used, and how to choose between them.
The shared foundation
Both CII and UBL carry the EN 16931 data model. That means the same business terms (BTs), the same business groups (BGs), and the same business rules (BRs) apply in both. An invoice serialized as CII and the same invoice serialized as UBL contain the same information. The difference is the element names, the document structure, and the XML namespace.
This is the part worth repeating: CII and UBL are two serializations of one data model. The compliance rules do not change between them. A XRechnung invoice in CII and a XRechnung invoice in UBL pass the same Schematron checks, because the rules operate on the semantic content, not the XML syntax.
CII: Cross Industry Invoice
CII stands for Cross Industry Invoice. It is a UN/CEFACT syntax, and the version in use for European e-invoicing is D16B. CII is the syntax XRechnung uses by default and the one ZUGFeRD embeds inside its PDF/A-3 container.
A CII document is rooted in the CrossIndustryInvoice element under
the UN/CEFACT namespace. The structure follows the
ExchangedDocumentContext, ExchangedDocument, and
SupplyChainTradeTransaction sections that anyone who has read a
XRechnung file will recognize.
CII is the more widely deployed syntax for German e-invoicing. The KoSIT validation artifacts, the ZUGFeRD specification, and most German recipient systems are built around it.
UBL: Universal Business Language
UBL stands for Universal Business Language. It is an OASIS standard,
and the version EN 16931 uses is 2.1. A UBL invoice is rooted in the
Invoice element under the OASIS UBL namespace, with a structure based
on cac (Common Aggregate Components) and cbc (Common Basic
Components) element groups.
UBL is the syntax you are more likely to encounter in cross-border and Peppol contexts. Peppol BIS Billing 3.0 is based on EN 16931 and commonly delivered as UBL. Some recipient systems, particularly those connected to the Peppol network, prefer or require UBL.
The key differences side by side
| CII | UBL | |
|---|---|---|
| Full name | Cross Industry Invoice | Universal Business Language |
| Standard body | UN/CEFACT | OASIS |
| Version in use | D16B | 2.1 |
| Root element | CrossIndustryInvoice | Invoice |
| Namespace | UN/CEFACT | OASIS UBL |
| Used by XRechnung | Yes (default) | Yes |
| Used by ZUGFeRD | Yes | No |
| Common in | Germany, ZUGFeRD | Peppol, cross-border |
Which syntax does XRechnung support?
XRechnung supports both. The KoSIT standard defines the CIUS in a
syntax-agnostic way, then publishes validation artifacts for both CII
and UBL. When you generate a XRechnung invoice with InvoiceSpec, you
choose the syntax in the config.syntax field:
"cii"produces a Cross Industry Invoice document. This is the default and the most widely supported syntax for XRechnung."ubl"produces a UBL 2.1 document. Some recipient systems prefer UBL, particularly in cross-border or Peppol contexts.
Both syntaxes carry the same EN 16931 data model and the same XRechnung business rules. The choice depends on what your recipient's system expects.
Which syntax does ZUGFeRD use?
ZUGFeRD uses CII only. The ZUGFeRD specification embeds CII D16B XML inside a PDF/A-3 container. There is no UBL variant of ZUGFeRD. If you need a human-readable PDF with embedded XML, the XML inside it is CII.
This is a practical constraint. If your recipient wants a ZUGFeRD PDF, you are sending CII. If your recipient wants a standalone XML file and prefers UBL, you are sending XRechnung or a plain EN 16931 document in UBL.
How to choose
The choice between CII and UBL comes down to what your recipient expects, not which one is better. A few rules of thumb:
- If you invoice German public authorities, XRechnung in CII is the default. Check whether your recipient accepts UBL if you have a reason to prefer it.
- If you deliver over Peppol or invoice recipients connected to the Peppol network, UBL is the more common choice.
- If you need a ZUGFeRD PDF, the embedded XML is CII. There is no UBL option.
- If you are unsure, CII is the safer default for German e-invoicing because it has the widest recipient support.
Because both syntaxes carry the same EN 16931 data model, you can
generate the same invoice in both from a single source payload. The
InvoiceSpec API accepts one JSON request and lets you select the
syntax in the config object, so you maintain one data model and
deliver in whichever syntax the recipient needs.
Frequently asked questions
Is CII better than UBL?
Neither is better. Both carry the same EN 16931 data model and pass the same business rules. The choice depends on what your recipient's system expects. CII has wider support in German e-invoicing. UBL is more common in Peppol and cross-border contexts.
Can I convert CII to UBL?
Because both syntaxes carry the same EN 16931 data model, the same
invoice can be generated in either syntax from one source payload. The
InvoiceSpec API lets you select the syntax in the config object, so
you generate the output you need rather than converting between formats.
Does ZUGFeRD support UBL?
No. ZUGFeRD embeds CII D16B XML inside a PDF/A-3 container. There is no UBL variant of ZUGFeRD. If you need UBL, generate a standalone XML file (XRechnung or a plain EN 16931 document) instead.
Generate invoices in either syntax
You can generate CII or UBL from a single API call. Read the
API reference
to see how the config.syntax field selects the output format, or
start a free trial
to generate your first compliant e-invoice in either syntax.
Mohamed Waleed
Founder, InvoiceSpec
Mohamed is the founder of InvoiceSpec, where he builds the e-invoicing infrastructure software companies use to ship compliant XRechnung, ZUGFeRD, and EN 16931 documents without maintaining the logic in-house. He writes about German e-invoicing compliance in plain terms for the finance and ops teams who have to meet it.
Related posts
Standards
Generate and validate XRechnung, EN 16931, and ZUGFeRD with one API — endpoint-specific schemas, examples, and recovery guidance.
Read the API reference