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.
XRechnung at a glance
Section titled “XRechnung at a glance”| What it is | A German CIUS of EN 16931: the European standard with stricter German rules on top |
| File type | Pure XML. No PDF. Needs a viewer to read |
| Syntaxes | UBL 2.1 or UN/CEFACT CII. Both have equal standing |
| Maintained by | KoSIT (Koordinierungsstelle für IT-Standards) in Bremen, on behalf of the IT Planning Council |
| Current version | 3.0.2. Version 3.0 in force since 1 February 2024, until at least 31 July 2027 |
| Next version | 4.0: pre-release 15 September 2026, final expected spring 2027 |
| Public sector | The standard format for federal invoices since 27 November 2020, and for most states |
| B2B | Counts as an e-invoice for German B2B sales since 2025 |
| Validator | The free KoSIT validator with the XRechnung configuration |
| Specification | Free from XStandards Einkauf |
When do you need an XRechnung?
Section titled “When do you need an XRechnung?”| Your situation | Do 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 authority | Usually yes. Each state has its own rules and portals, so check the order or contract |
| Invoicing a German business that asked for XRechnung | Yes, if that’s what they want. It counts as a German B2B e-invoice |
| Invoicing a German business, no format requested | XRechnung 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 government | Not required. The federal E-Invoicing Ordinance exempts these, though you can still send one |
| Invoicing a French business | No. France uses UBL, CII or Factur-X under French rules, through an approved platform |
| Invoicing customers in Belgium or the Netherlands | No. 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:
| Rule | What it requires | Business term |
|---|---|---|
| BR-DE-15 | A buyer reference on every invoice (the Leitweg-ID for public bodies) | BT-10 |
| BR-DE-2, -5, -6, -7 | A seller contact: name, phone number and email | BG-6 (BT-41, BT-42, BT-43) |
| BR-DE-3, -4, -8, -9 | City and post code for both seller and buyer | BT-37, BT-38, BT-52, BT-53 |
| BR-DE-1 | Payment instructions, such as a bank transfer with IBAN | BG-16 |
| BR-DE-14 | A VAT rate in every VAT breakdown | BT-119 |
| BR-DE-18 | Early-payment discounts (Skonto) in a fixed text format, for example #SKONTO#TAGE=14#PROZENT=2.00# | BT-20 |
| BR-DE-21 | The XRechnung specification identifier | BT-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.
UBL or CII: the two syntaxes
Section titled “UBL or CII: the two syntaxes”XRechnung carries the same data in either of the two XML syntaxes EN 16931 allows:
| UBL 2.1 | UN/CEFACT CII | |
|---|---|---|
| Origin | OASIS, also ISO/IEC 19845 | United Nations trade facilitation body (UN/CEFACT) |
| Root element | Invoice or CreditNote | CrossIndustryInvoice |
| Also used by | Peppol BIS Billing 3.0 (Belgium, the Netherlands, the Nordics) | ZUGFeRD and Factur-X |
| Good fit if | You also send over Peppol | Your 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.
What an XRechnung looks like
Section titled “What an XRechnung looks like”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.
XRechnung versions
Section titled “XRechnung versions”| Version | In force | Notes |
|---|---|---|
| 1.0 to 1.2.2 | June 2017 to December 2020 | Early versions for the federal B2G rollout |
| 2.0.x to 2.3.1 | January 2021 to 31 January 2024 | Annual updates. 2.3 was retired on 1 February 2024 |
| 3.0.0 / 3.0.1 | 3.0.1 in force from 1 February 2024 | Aligned with Peppol BIS Billing: BT-23, BT-34 and BT-49 became mandatory. KoSIT advised against using 3.0.0 |
| 3.0.2 | Specification dated 20 June 2024, bundle 2 July 2024 | Current. 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.0 | Pre-release 15 September 2026, final expected spring 2027 | Based 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
Section titled “The Leitweg-ID”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):
| Part | Format | Example 04011000-1234512345-06 |
|---|---|---|
| Coarse address (Grobadressierung) | 2 to 12 digits: federal level, state, district, municipality | 04011000 |
| Fine address (Feinadressierung), optional | Up to 30 letters or digits, chosen by the authority | 1234512345 |
| Check digits (Prüfziffer) | 2 digits, calculated with Modulo 97-10, the same method as an IBAN | 06 |
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.
How to send an XRechnung
Section titled “How to send an XRechnung”XRechnung is a format, not a delivery channel. How you send it depends on who the customer is.
To the federal government: OZG-RE
Section titled “To the federal government: OZG-RE”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.
To states and municipalities
Section titled “To states and municipalities”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.
To German businesses (B2B)
Section titled “To German businesses (B2B)”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.
XRechnung vs ZUGFeRD vs Factur-X
Section titled “XRechnung vs ZUGFeRD vs Factur-X”| XRechnung | ZUGFeRD | Factur-X | EN 16931 | |
|---|---|---|---|---|
| What it is | German CIUS of EN 16931, pure XML | Hybrid: PDF/A-3 + CII XML | Hybrid: PDF/A-3 + CII XML (same as ZUGFeRD) | The European standard behind all of them |
| Readable without software? | No | Yes | Yes | Not a file format |
| Syntax | UBL or CII | CII | CII | Defines the data. UBL and CII are its syntaxes |
| Maintained by | KoSIT | FeRD with FNFE-MPE | FNFE-MPE with FeRD | CEN |
| Current version | 3.0.2 (4.0 expected 2027) | 2.5.2 | 1.09.2 | EN 16931-1:2026 |
| German public sector | The standard | Sometimes, via the XRECHNUNG profile | Rarely | Reference standard |
| German B2B | Yes | Yes, except MINIMUM and BASIC WL | Yes, same rules as ZUGFeRD | Reference for what counts |
| Extra national rules | BR-DE rules (buyer reference, seller contact, payment details) | Profile rules | French BR-FR rules in France | None. The base standard |
How to create an XRechnung
Section titled “How to create an XRechnung”1. Your invoicing or accounting software
Section titled “1. Your invoicing or accounting software”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.
2. The federal web form
Section titled “2. The federal web form”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.
3. An invoicing API
Section titled “3. An invoicing API”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.
4. Open-source libraries
Section titled “4. Open-source libraries”| Library | Language | XRechnung support | Licence |
|---|---|---|---|
| Mustang | Java | Reads, writes and validates XRechnung 3.0.2 in CII syntax, and can convert CII to UBL | Apache 2.0 |
| horstoeko/zugferd | PHP | Builds and reads ZUGFeRD and CII XRechnung documents | MIT |
| factur-x by Akretion | Python | Generates CII and UBL XML from a dictionary keyed by EN 16931 business terms, and checks against schemas and schematrons | BSD-style |
| xrechnung-visualization by KoSIT | XSLT | Turns an XRechnung into readable HTML or PDF | Apache 2.0 |
All four were updated in 2026. For any library, run its output through the KoSIT validator as part of your tests.
How to validate an XRechnung
Section titled “How to validate an XRechnung”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:
- The validator itself: itplr-kosit/validator. The current release is 1.6.3 (August 2026).
- 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:
java -jar validator-1.6.3-standalone.jar -s scenarios.xml -r . invoice-2026-118.xmlThe 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
| Error | Fix |
|---|---|
| BR-DE-15: Buyer reference missing | Add the Leitweg-ID (public sector) or the customer’s reference (B2B) in BT-10 |
| BR-DE-2, -6, -7: seller contact incomplete | Add a contact name, phone number and email in BG-6 |
| Seller or buyer electronic address missing | Add BT-34 and BT-49, for example an email address with scheme EM (not allowed over Peppol) |
| Business process type missing | Add BT-23, for example urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 |
Wrong CustomizationID | Use the XRechnung 3.0 identifier shown above |
| BR-DE-18: Skonto text in the wrong format | Use the #SKONTO#TAGE=..#PROZENT=..# format in BT-20 |
| BR-DE-19: invalid IBAN | Check 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.
How GoodVat helps
Section titled “How GoodVat helps”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.
What is an XRechnung?
Section titled “What is an XRechnung?”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.
What is the current XRechnung version?
Section titled “What is the current XRechnung version?”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.
What is a Leitweg-ID?
Section titled “What is a Leitweg-ID?”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.
Do I need a Leitweg-ID for B2B invoices?
Section titled “Do I need a Leitweg-ID for B2B invoices?”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.
Should I use UBL or CII for XRechnung?
Section titled “Should I use UBL or CII for XRechnung?”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.
How do I open or read an XRechnung file?
Section titled “How do I open or read an XRechnung file?”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.
How do I validate an XRechnung?
Section titled “How do I validate an XRechnung?”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.
Related guides
Section titled “Related guides”- E-invoicing in Europe: every EU mandate, the main formats and the ViDA timeline
- E-invoicing in Germany: the 2025, 2027 and 2028 dates, exceptions and foreign businesses
- ZUGFeRD explained: the hybrid PDF alternative, its versions and profiles
- Factur-X explained: the French twin of ZUGFeRD
- EN 16931 explained: the European standard, business terms and CIUS
- E-invoicing in Belgium: Peppol BIS Billing 3.0, the other common EN 16931 format
- Selling to Germany: rates, rules and compliance: German VAT rates and invoicing basics