What is XRechnung?
XRechnung is Germany's standard for invoices to the public sector: a pure XML document, no PDF layer, defined as the national usage specification (CIUS) of the European norm EN 16931 and maintained by KoSIT. Since the end of 2020, federal authorities require it, and the states have followed with their own portals; whoever supplies a German Behoerde invoices in XRechnung.
Pure XML is the point: public-sector invoice processing is fully automated, so the format optimizes for machines. Humans read an XRechnung through a viewer, not by opening the file.
One standard, two syntaxes
An XRechnung can be written in either of the two EN 16931 XML syntaxes: UN/CEFACT CII (the syntax ZUGFeRD also uses) or UBL. What makes the file an XRechnung is not the syntax but the declaration and the rules it satisfies. The declaration sits at the top:
<ram:GuidelineSpecifiedDocumentContextParameter>
<ram:ID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter>
The German rules on top of EN 16931
The CIUS adds national business rules (the BR-DE series) that a plain EN 16931 invoice does not need. The ones that reject the most files in practice:
- The buyer reference (BT-10) must carry the Leitweg-ID; without it the invoice fails BR-DE-15 immediately.
- The seller must provide a contact with phone or email, so the authority can reach a human about the invoice.
- Both parties need an electronic address, and payment details must use the permitted means codes with the matching account data.
Every rule is machine-checked on receipt by the portals, which is why validating before sending is not optional in practice.
The Leitweg-ID, in one minute
The Leitweg-ID identifies the receiving authority's invoice inbox and routes your document to it, following the pattern {authority-id}-{optional-suffix}-{check-digit}. You receive it from the contracting authority, usually with the order. Ask for it before invoicing: it cannot be guessed, and its absence is the most common reason an XRechnung bounces.
How the file reaches the authority
Federal authorities receive through the ZRE portal, most states through OZG-RE or state-specific platforms, and a growing share accept delivery over the Peppol network. The XML is identical on every route; only the transport differs.
XRechnung and ZUGFeRD
The two German formats split the market by recipient: XRechnung for authorities, ZUGFeRD for companies. They share the EN 16931 data model and the CII syntax, so the same invoice data can produce either file. For the hybrid B2B side, read the companion guide:
Sample files to download
Both files were generated and validated with the tools on this site; the data is fictitious. The invalid one fails exactly one rule, which makes it a precise test case.