Contents
What this is. A technical description of an invoice file format, written for people who have to produce one. It is not tax or legal advice. Whether and from when German e-invoicing rules apply to your business is a question for your tax advisor. Where this page states dates or rules, it names the official source so you can check it yourself.
If you invoice customers in Germany, you may be asked for an XRechnung. It is not a PDF, not a scan and not an email layout: it is a structured XML file that the recipient's software reads without a human in between.
What an XRechnung is
| What it means | |
|---|---|
| Standard | European norm EN 16931 |
| German profile | XRechnung (currently 3.0.2), published by KoSIT |
| Syntax | UBL or CII — both allowed, UBL is the common choice |
| File | one .xml file per invoice |
| How you recognise it | the element cbc:CustomizationID ends with xrechnung_3.0 |
There is also a hybrid variant: a PDF with the same XML embedded inside it (ZUGFeRD / Factur-X). Human-readable and machine-readable in one file. German public authorities generally expect the pure XML; business customers often accept both. Ask the recipient before the first invoice.
You can look at a real one: download a valid example file, or run that example through the checker to see what a validation report looks like.
The fields that have to be there
Beyond the usual invoice content, the German profile requires a few things that paper invoices often leave out. The codes in brackets are the field numbers from EN 16931 — they are the same in every program, so you can search for them.
| What | Field | Note |
|---|---|---|
| Invoice number, invoice date | BT-1, BT-2 | |
| Invoice type code | BT-3 | 380 for an ordinary invoice |
| Currency | BT-5 | EUR for domestic German invoices |
| Buyer reference | BT-10 | mandatory in the German profile; for public authorities this is the Leitweg-ID |
| Seller name, address, country | BT-27, BG-5, BT-40 | |
| Seller VAT ID or tax number | BT-31 / BT-32 | at least one of the two |
| Seller contact: name, phone, email | BT-41, BT-42, BT-43 | all three, this is a German-profile rule |
| Buyer name, address, electronic address | BT-44, BG-8, BT-49 | |
| Payment means code | BT-81 | 58 = SEPA credit transfer |
| Bank account | BG-17 | required whenever the payment means is a credit transfer |
| Due date or payment terms | BT-9 / BT-20 | one of the two, otherwise the totals rule fails |
| Line items with quantity, unit code, net price, tax category | BG-25 | the unit is a code, not a word |
Two of these surprise newcomers: the seller's phone number and email address are mandatory, and quantities carry a code rather than a word (H87 = piece, HUR = hour, C62 = a lump sum). The German reference tables are units, payment means and invoice types; the codes themselves are language-independent.
Leitweg-ID: only for public authorities
Invoices to German federal, state or municipal bodies carry a routing identifier called Leitweg-ID. It identifies the receiving unit, it is issued by that body, and you cannot look it up or invent it — ask your contact there. Its structure is explained in Leitweg-ID (German). For ordinary business customers it is not needed; the buyer reference field then holds whatever reference the customer asks for, for example an order number.
How to produce one
| Situation | Way |
|---|---|
| A few invoices | fill in the form and download the XML |
| The invoice already exists as a PDF | upload it to the scanner and check what it extracted |
| Many invoices from your own system | the REST API |
The form and the API validate before they hand you the file. The interface is available in English, French and Spanish; the invoice content itself is yours.
Check before you send
An XRechnung can be checked by machine, and it is worth doing every time. A file that fails validation is usually rejected automatically by the recipient, which costs more time than the check. Upload any XML to the free checker — no account needed. The official German validator is the open-source KoSIT validator, and the checker runs it where available.
If a report comes back with codes like BR-DE-15 or BR-CO-10, those are rule identifiers. Each one names a missing field or a total that does not add up; the German reference list is XRechnung-Fehlercodes, and the codes themselves are the same in any tool.
The dates, as published by the German Ministry of Finance
The German Federal Ministry of Finance (BMF) has published the following schedule for domestic business-to-business invoicing: receiving electronic invoices applies from 1 January 2025, issuing them from 2027 for businesses above a turnover threshold in the previous year, and from 2028 for the remainder. Separately, invoices to German public authorities have required an electronic format since 2020.
Whether your business falls under these rules — and what counts as being established in Germany — depends on your situation and is a question for your tax advisor. The source is linked below; this page does not interpret it for you.
Frequently asked questions
Do I need a German account or a German address to create an XRechnung?
No. The format does not care where you are. What it requires is the data listed above, including a VAT identification number or a tax number for the seller.
Can I just send a PDF instead?
That depends on what the recipient accepts, and in some cases on rules that apply to them rather than to you. Technically, a PDF is not an XRechnung: an XRechnung is the XML file. A hybrid PDF with embedded XML satisfies both the machine and the human reader.
Are the other articles available in English?
No. The rest of the guide explains German tax and invoicing rules and is written in German, where the terminology is precise and the sources are in the same language. This page covers the technical ground; for the legal questions, ask an advisor who can answer for your case.
Where do I see what a valid file looks like?
Download the example and open it in any text editor, or send it through the checker. The structure in that file is the structure every XRechnung has.
- KoSIT / xeinkauf.de: XRechnung specification and bundles
- Peppol BIS Billing 3.0: UBL invoice syntax and code lists
- German Federal Ministry of Finance: questions and answers on the electronic invoice (German)
- KoSIT validator (open source)
- EN 16931-1 (business terms BT-/BG-), EN 16931-3 (code lists)
General information, not tax or legal advice. For your specific case, ask your tax advisor.
These articles are written with AI assistance and reviewed before publication. The sources used and the review date are shown with every article.