Skip to content
EN

XRechnung Explained: Format, Leitweg-ID and How to Send One

Short answer: XRechnung is Germany’s national e-invoice format: a pure XML file (in UBL or CII syntax) that follows the European standard EN 16931 plus some extra German rules. It’s the standard for invoicing German public bodies, where it usually needs a Leitweg-ID routing code, and it also counts as an e-invoice for German B2B sales. The current version is XRechnung 3.0.2. Version 4.0 is in preparation, expected in spring 2027.

This guide is for small businesses and developers who’ve been asked for an XRechnung by a German customer or a public authority. For who must issue e-invoices in Germany and when, see E-invoicing in Germany. For the hybrid PDF alternative, see ZUGFeRD explained.

What it isA German CIUS of EN 16931: the European standard with stricter German rules on top
File typePure XML. No PDF. Needs a viewer to read
SyntaxesUBL 2.1 or UN/CEFACT CII. Both have equal standing
Maintained byKoSIT (Koordinierungsstelle für IT-Standards) in Bremen, on behalf of the IT Planning Council
Current version3.0.2. Version 3.0 in force since 1 February 2024, until at least 31 July 2027
Next version4.0: pre-release 15 September 2026, final expected spring 2027
Public sectorThe standard format for federal invoices since 27 November 2020, and for most states
B2BCounts as an e-invoice for German B2B sales since 2025
ValidatorThe free KoSIT validator with the XRechnung configuration
SpecificationFree from XStandards Einkauf
Your situationDo you need XRechnung?
Invoicing a German federal body (ministry, agency)Yes, in practice. E-invoices are required, XRechnung is the standard, and you’ll need the body’s Leitweg-ID
Invoicing a German state or local authorityUsually yes. Each state has its own rules and portals, so check the order or contract
Invoicing a German business that asked for XRechnungYes, if that’s what they want. It counts as a German B2B e-invoice
Invoicing a German business, no format requestedXRechnung or ZUGFeRD both count. ZUGFeRD is easier for small customers, because it includes a readable PDF
A public direct order of €1,000 net or less for the federal governmentNot required. The federal E-Invoicing Ordinance exempts these, though you can still send one
Invoicing a French businessNo. France uses UBL, CII or Factur-X under French rules, through an approved platform
Invoicing customers in Belgium or the NetherlandsNo. They use Peppol BIS Billing 3.0, a different EN 16931 format

What makes XRechnung different from “plain” EN 16931

Section titled “What makes XRechnung different from “plain” EN 16931”

EN 16931 is the European standard for what an e-invoice contains. It leaves many fields optional. A CIUS (Core Invoice Usage Specification) is a national or sector rulebook that makes some optional fields mandatory and adds checks, without breaking the standard. XRechnung is Germany’s CIUS. Every valid XRechnung is a valid EN 16931 invoice, but not the other way round.

The German rules are coded BR-DE-1, BR-DE-2 and so on. The ones that trip people up most:

RuleWhat it requiresBusiness term
BR-DE-15A buyer reference on every invoice (the Leitweg-ID for public bodies)BT-10
BR-DE-2, -5, -6, -7A seller contact: name, phone number and emailBG-6 (BT-41, BT-42, BT-43)
BR-DE-3, -4, -8, -9City and post code for both seller and buyerBT-37, BT-38, BT-52, BT-53
BR-DE-1Payment instructions, such as a bank transfer with IBANBG-16
BR-DE-14A VAT rate in every VAT breakdownBT-119
BR-DE-18Early-payment discounts (Skonto) in a fixed text format, for example #SKONTO#TAGE=14#PROZENT=2.00#BT-20
BR-DE-21The XRechnung specification identifierBT-24

Since 1 February 2024 (version 3.0.1), three more fields are mandatory, according to the federal e-invoicing site: the business process type (BT-23), the seller’s electronic address (BT-34) and the buyer’s electronic address (BT-49). The change brought XRechnung in line with Peppol BIS Billing. For a small business sending by email or through OZG-RE, an email address with the scheme code EM usually works as the electronic address. Peppol itself doesn’t accept EM, so over Peppol you use your Peppol ID instead.

The rule list above comes from KoSIT’s published XRechnung schematron. For complex cases, such as third-party payments or detailed sub-lines, KoSIT also publishes an XRechnung Extension, with its own specification identifier. Only use it if your customer asks for it.

XRechnung carries the same data in either of the two XML syntaxes EN 16931 allows:

UBL 2.1UN/CEFACT CII
OriginOASIS, also ISO/IEC 19845United Nations trade facilitation body (UN/CEFACT)
Root elementInvoice or CreditNoteCrossIndustryInvoice
Also used byPeppol BIS Billing 3.0 (Belgium, the Netherlands, the Nordics)ZUGFeRD and Factur-X
Good fit ifYou also send over PeppolYour software also makes ZUGFeRD files

German public bodies must accept both. If you have no reason to pick one, ask your software which it handles best.

Here is a shortened excerpt of an XRechnung in UBL syntax, for a design studio invoicing a public body. The comments show the EN 16931 business terms.

<ubl:Invoice xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
<!-- BT-24: "this is an XRechnung 3.0" -->
<cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</cbc:CustomizationID>
<!-- BT-23: business process type, mandatory since XRechnung 3.0.1 -->
<cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID>
<cbc:ID>2026-118</cbc:ID> <!-- BT-1: invoice number -->
<cbc:IssueDate>2026-11-02</cbc:IssueDate> <!-- BT-2: issue date -->
<cbc:DueDate>2026-12-02</cbc:DueDate> <!-- BT-9: due date -->
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode> <!-- BT-3: commercial invoice -->
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode> <!-- BT-5 -->
<cbc:BuyerReference>04011000-1234512345-06</cbc:BuyerReference> <!-- BT-10: Leitweg-ID -->
<cac:AccountingSupplierParty>
<cac:Party>
<cbc:EndpointID schemeID="EM">invoices@studio.example.com</cbc:EndpointID> <!-- BT-34 -->
<!-- ...name, address and VAT number... -->
<cac:Contact> <!-- BG-6: required in XRechnung -->
<cbc:Name>Jana Weber</cbc:Name> <!-- BT-41 -->
<cbc:Telephone>+49 30 1234567</cbc:Telephone> <!-- BT-42 -->
<cbc:ElectronicMail>jana@studio.example.com</cbc:ElectronicMail> <!-- BT-43 -->
</cac:Contact>
</cac:Party>
</cac:AccountingSupplierParty>
<!-- ...buyer, payment details, VAT breakdown, totals and lines... -->
</ubl:Invoice>

The CustomizationID tells validators to apply XRechnung 3.0 rules. The same value works for every 3.0.x release. When 4.0 arrives, it will change.

VersionIn forceNotes
1.0 to 1.2.2June 2017 to December 2020Early versions for the federal B2G rollout
2.0.x to 2.3.1January 2021 to 31 January 2024Annual updates. 2.3 was retired on 1 February 2024
3.0.0 / 3.0.13.0.1 in force from 1 February 2024Aligned with Peppol BIS Billing: BT-23, BT-34 and BT-49 became mandatory. KoSIT advised against using 3.0.0
3.0.2Specification dated 20 June 2024, bundle 2 July 2024Current. Editorial changes only compared with 3.0.1. KoSIT has since published bug-fix bundles, most recently on 31 August 2026, plus a visualisation fix on 13 October 2026
4.0Pre-release 15 September 2026, final expected spring 2027Based on the revised EN 16931-1:2026, with more than 50 new business terms. Not for production use yet

Source: KoSIT’s versions and bundles page, which says there was no normative release in summer 2026, so version 3.0 stays in force until at least 31 July 2027.

What 4.0 is reported to bring: multiple orders and deliveries on one invoice, several buyer references, XML attachments, and structured early-payment discount data. KoSIT will set the transition period when it publishes the final bundle. Until then, keep issuing 3.0.2, and don’t send 4.0 pre-release files to customers.

The Leitweg-ID is a routing code for German public sector invoices. It tells the receiving platform which authority, and which office within it, the invoice is for. Without it, your invoice to a public body is likely to be rejected.

Where to get it: from your public sector customer. It’s usually in the order, contract or tender documents. If it isn’t, ask the buyer. You can’t make one up, and there’s no public lookup you should rely on instead of the buyer’s own instruction.

Where it goes: in the Buyer reference field (BT-10). In UBL that’s cbc:BuyerReference. In CII it’s ram:BuyerReference.

How it’s built (from KoSIT’s Leitweg-ID format specification):

PartFormatExample 04011000-1234512345-06
Coarse address (Grobadressierung)2 to 12 digits: federal level, state, district, municipality04011000
Fine address (Feinadressierung), optionalUp to 30 letters or digits, chosen by the authority1234512345
Check digits (Prüfziffer)2 digits, calculated with Modulo 97-10, the same method as an IBAN06

The parts are separated by hyphens, and the whole ID is between 5 and 46 characters. Federal Leitweg-IDs start with 991 (direct federal administration) or 992 (indirect federal administration, such as foundations and public-law institutions).

On Peppol, the Leitweg-ID also serves as the buyer’s Peppol address, with the scheme code 0204.

For B2B invoices you don’t need a Leitweg-ID. But BR-DE-15 still requires a Buyer reference, so put in whatever reference your customer gives you: a purchase order number, a cost centre or a contact name.

XRechnung is a format, not a delivery channel. How you send it depends on who the customer is.

Invoices to the federal administration go to the federal invoice receipt platform OZG-RE. The older central platform ZRE was merged into it and switched off in September 2025. Registration is free, and you can also log in with an ELSTER business account (Mein Unternehmenskonto).

OZG-RE accepts invoices through:

  • Web form (Weberfassung): type the invoice in your browser, and the platform creates the XRechnung for you. This is the simplest option if you invoice a federal body only occasionally.
  • Upload of an XRechnung file you created elsewhere
  • Email, after registering your sending address
  • Peppol, through a Peppol access point

The federal e-invoicing site has the registration link and user guides. Federal e-invoicing has been required since 27 November 2020 under the E-Invoicing Ordinance (E-Rechnungsverordnung), except for direct orders of €1,000 net or less.

Each federal state (Land) sets its own e-invoicing rules for its authorities and municipalities, including dates, thresholds and portals. Many accept Peppol or run their own portal. The order or contract normally says how to send the invoice and gives the Leitweg-ID. If it doesn’t, ask before you invoice.

Since 1 January 2025, XRechnung has counted as an e-invoice for sales between German businesses. You can send it by email, over Peppol, by EDI or through a customer portal. There’s no government platform for B2B, and no Leitweg-ID. The Germany guide covers when issuing becomes mandatory: 2027 for businesses with more than €800,000 turnover, 2028 for everyone else.

One practical point: a pure XML file is a poor experience for a small customer without e-invoice software. If your B2B customers are small shops, ZUGFeRD may suit them better. It meets the same legal requirement and they can still open the PDF. ZUGFeRD’s XRECHNUNG profile even carries XRechnung data inside a PDF.

XRechnungZUGFeRDFactur-XEN 16931
What it isGerman CIUS of EN 16931, pure XMLHybrid: PDF/A-3 + CII XMLHybrid: PDF/A-3 + CII XML (same as ZUGFeRD)The European standard behind all of them
Readable without software?NoYesYesNot a file format
SyntaxUBL or CIICIICIIDefines the data. UBL and CII are its syntaxes
Maintained byKoSITFeRD with FNFE-MPEFNFE-MPE with FeRDCEN
Current version3.0.2 (4.0 expected 2027)2.5.21.09.2EN 16931-1:2026
German public sectorThe standardSometimes, via the XRECHNUNG profileRarelyReference standard
German B2BYesYes, except MINIMUM and BASIC WLYes, same rules as ZUGFeRDReference for what counts
Extra national rulesBR-DE rules (buyer reference, seller contact, payment details)Profile rulesFrench BR-FR rules in FranceNone. The base standard

Most German invoicing and accounting tools can export XRechnung. When you check yours, ask:

  • Which version it produces. It should be 3.0.x today, and the vendor should have a plan for 4.0.
  • UBL, CII or both.
  • Whether it fills the German mandatory fields: Buyer reference, seller phone and email, electronic addresses and payment details. A common failure is a template with no field for the Leitweg-ID.
  • Whether it validates the file with the KoSIT rules before you send it.

For occasional invoices to federal bodies, the OZG-RE web form creates a valid XRechnung for you and sends it. You can download a copy for your records. It’s free, but it only works for federal recipients, not for states, municipalities or businesses.

If you bill from your own platform, an e-invoicing API can turn your invoice data into XRechnung (UBL or CII), validate it and, if you need it, deliver it over Peppol. Ask which XRechnung version is supported, how quickly they move to new versions, and whether you get the KoSIT validation report back.

LibraryLanguageXRechnung supportLicence
MustangJavaReads, writes and validates XRechnung 3.0.2 in CII syntax, and can convert CII to UBLApache 2.0
horstoeko/zugferdPHPBuilds and reads ZUGFeRD and CII XRechnung documentsMIT
factur-x by AkretionPythonGenerates CII and UBL XML from a dictionary keyed by EN 16931 business terms, and checks against schemas and schematronsBSD-style
xrechnung-visualization by KoSITXSLTTurns an XRechnung into readable HTML or PDFApache 2.0

All four were updated in 2026. For any library, run its output through the KoSIT validator as part of your tests.

The reference tool is the KoSIT validator, published by the same body that writes XRechnung. It’s a free Java program, used by many public sector platforms and software vendors.

You need two downloads, both on GitHub:

  1. The validator itself: itplr-kosit/validator. The current release is 1.6.3 (August 2026).
  2. The XRechnung configuration: validator-configuration-xrechnung. The current release, dated 31 August 2026, is for XRechnung 3.0.2. It bundles the XRechnung rules and the European EN 16931 rules.

Unzip the configuration, then run:

Terminal window
java -jar validator-1.6.3-standalone.jar -s scenarios.xml -r . invoice-2026-118.xml

The validator writes a report next to the file. It checks the XML against the schema, the EN 16931 business rules and the German BR-DE rules, and gives a recommendation: accept, or reject. The Mustang command-line tool is an alternative for CII files.

Most common XRechnung errors

ErrorFix
BR-DE-15: Buyer reference missingAdd the Leitweg-ID (public sector) or the customer’s reference (B2B) in BT-10
BR-DE-2, -6, -7: seller contact incompleteAdd a contact name, phone number and email in BG-6
Seller or buyer electronic address missingAdd BT-34 and BT-49, for example an email address with scheme EM (not allowed over Peppol)
Business process type missingAdd BT-23, for example urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
Wrong CustomizationIDUse the XRechnung 3.0 identifier shown above
BR-DE-18: Skonto text in the wrong formatUse the #SKONTO#TAGE=..#PROZENT=..# format in BT-20
BR-DE-19: invalid IBANCheck the bank account (BT-84) when the payment means is SEPA transfer (code 58)

Worked example: a Berlin studio invoicing a federal agency

Section titled “Worked example: a Berlin studio invoicing a federal agency”

A two-person design studio in Berlin builds a website for a federal agency. The order gives the agency’s Leitweg-ID, which starts with 991.

  • Fee: €4,500.00 net
  • VAT at 19%: €855.00
  • Total: €5,355.00

The studio’s invoicing tool doesn’t export XRechnung yet. So it registers on OZG-RE, opens the web form, and enters:

  • the Leitweg-ID as the Buyer reference
  • its own name, address and VAT number, plus a contact name, phone and email
  • one line: “Website design and build, order 2026-0457”, quantity 1, €4,500.00, 19% VAT
  • its IBAN and a 30-day payment term

The platform generates the XRechnung, checks it and forwards it to the agency. The studio downloads the XML and keeps it for 8 years. Next year, when it has more public clients, it switches to an invoicing tool with XRechnung export and validation built in.

An XRechnung passes validation only if the VAT data inside it is right: the correct rate and VAT category, the reverse charge where it applies, and the right VAT numbers. GoodVat Global Tax Compliance takes care of that side:

  • Maps your obligations: which e-invoice formats and mandates apply in Germany, France and every other country you invoice into
  • Registers you for German VAT, OSS or IOSS where you need it
  • Calculates the right VAT for every customer and sends compliant invoices
  • Files your VAT returns in the EU, the UK and US states

GoodVat is not an e-invoicing platform, a Peppol access point or a format validator. Use OZG-RE, your invoicing software and the KoSIT validator for the file itself.

XRechnung is Germany’s national e-invoice format: an XML file that follows the European standard EN 16931 plus a set of extra German rules. It is maintained by KoSIT on behalf of Germany’s IT Planning Council. It is the standard format for invoices to German public bodies and also counts as an e-invoice for German B2B sales.

XRechnung 3.0.2, part of version 3.0, which has been in force since 1 February 2024. KoSIT says 3.0 will stay in force until at least 31 July 2027. A pre-release of XRechnung 4.0, based on the revised EN 16931-1:2026, was published on 15 September 2026, with the final version expected in spring 2027.

A Leitweg-ID is a routing ID that tells the German public sector’s invoice systems which office an invoice is for. Your public sector customer gives it to you, usually in the order or contract. It goes in the Buyer reference field (BT-10) of the XRechnung. Federal bodies’ IDs start with 991 or 992.

No. The Leitweg-ID is only for invoices to German public bodies. But XRechnung still requires something in the Buyer reference field (BT-10), so for business customers you put a reference they give you, such as a purchase order number or a contact name.

Is XRechnung mandatory for B2B in Germany?

Section titled “Is XRechnung mandatory for B2B in Germany?”

No specific format is mandatory for German B2B invoices. From 2027 and 2028 German businesses must issue e-invoices to other German businesses, and XRechnung is one accepted format. ZUGFeRD from version 2.0.1 (except the MINIMUM and BASIC WL profiles) and other EN 16931 formats agreed with the customer also count.

Either. XRechnung is defined in both syntaxes and German public bodies must accept both. UBL is common if you also send invoices over Peppol, and CII is common if your software also makes ZUGFeRD files, because ZUGFeRD uses CII. Choose whichever your software and your customers handle best.

An XRechnung is plain XML, so a PDF reader can’t show it. Use a viewer: many accounting tools display XRechnung files, and KoSIT publishes free visualisation stylesheets that turn the XML into readable HTML or PDF. Keep the original XML file for 8 years, because that file, not a printout, is the invoice.

Use the KoSIT validator with the official XRechnung configuration, both free on GitHub. It checks the XML against the schema, the European EN 16931 rules and the German BR-DE rules, and produces a report that says whether to accept the file. Many invoicing tools and online validators run the same checks.