Format guide

The XRechnung Format, Explained

What an XRechnung is, which German rules it adds to the European norm, how the Leitweg-ID routes your invoice, and verified sample files to download.

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.

Frequently Asked Questions

Common questions about the XRechnung format.

Suppliers invoicing German public-sector buyers: federal authorities have required it since the end of 2020, and the states have followed with their own portals and thresholds. For invoices between companies, XRechnung is not required.
Both are valid XRechnung, and the receiving portals accept either. CII is the natural choice if your systems already speak ZUGFeRD or Factur-X; UBL if your pipeline is Peppol-centric. The rules that make a file an XRechnung are the same in both.
A routing identifier for the authority's invoice inbox, carried in the buyer reference (BT-10) and following the pattern {authority-id}-{optional-suffix}-{check-digit}. The contracting authority issues it; a missing or malformed one is the single most common rejection reason.
KoSIT maintains it and publishes updates on a regular cycle, typically with new releases each year. Files must declare the version they follow, and validators apply the matching rule set; the tools on this site track the current release.
ZUGFeRD 2.x defines an XRECHNUNG reference profile carrying the same data in a hybrid PDF, but public portals expect the pure XML. When invoicing an authority, submit the XML itself; keep hybrid PDFs for B2B.
Yes. It is published by KoSIT (Koordinierungsstelle fuer IT-Standards) and freely available; no license fees apply to creating or processing XRechnung invoices.
Ready for mandatory e-invoicing?

Make every invoice compliant, in a single message

Subscribe to get unlimited tools, choosable compliance profiles and the full set of premium features.

EN 16931 & PDF/A-3b compliant Results in seconds No installation Data never stored
3 free uses per day · No card required