What is XRechnung?
XRechnung is Germany's standard for structured electronic invoices, based on the European norm EN 16931. Unlike a PDF, which is made for a human to read, an XRechnung is an XML file made for a machine to read — so accounting systems can process it automatically, with no manual re-typing.
An XRechnung is not “a PDF with a QR code.” It is a specific XML document with defined fields and rules. This guide explains those fields and shows you how to produce a valid one.
Who must use XRechnung?
If you supply goods or services to German public authorities (a B2G relationship — business to government), you are generally required to invoice them electronically as an XRechnung. This obligation has been rolling out across federal and state bodies since 2020.
E-invoicing is also expanding into business-to-business (B2B) trade in Germany, so understanding XRechnung is increasingly useful even if you don't invoice the public sector today.
What is a Leitweg-ID?
The Leitweg-ID (routing ID) is the address that tells Germany's public-sector invoicing platforms which authority an XRechnung should be delivered to. The public body you're invoicing gives it to you — it's not something you invent.
It only applies when your buyer is a German public authority. For a normal business client, you can leave it blank.
Buyer reference, tax treatment & required fields
Beyond the usual invoice details, an XRechnung has a few fields that must be present:
- Buyer reference (BT-10) — your order or purchase-order number at the client. This is mandatory.
- Seller tax identifier — a VAT ID or a tax number.
- Full postal addresses for both parties, including the country.
- A tax treatment for the invoice: standard VAT, the §19 small-business exemption, zero-rated, or reverse charge.
- Payment details (IBAN) so the invoice can actually be paid.
How to create an XRechnung, step by step
Follow these steps in the free exporter. The XML is built on your device — nothing is uploaded — and you get a readable PDF to send alongside it.
-
Enter your seller details and tax ID
Add your name or business, full address including country, and either a VAT ID or a tax number. The live status panel shows which required fields are still missing.
-
Add the buyer and the Leitweg-ID
Enter your client's name and full address. Add your reference at the client (the order/PO number) and, if they're a German public authority, the exact Leitweg-ID they gave you.
-
Set the number and dates
Give the invoice a number, an issue date, and a due date. Add a delivery or service date if it differs from the issue date.
-
Choose your tax treatment
Pick standard VAT and a rate, or the §19 small-business exemption, zero-rated, or reverse charge. The correct tax category and any exemption note are set for you.
-
Add your line items
Add a row for each item with a description, quantity, unit, and rate. Units use the standard codes an XRechnung expects (piece, hour, day, and so on).
-
Add payment details
Enter your IBAN (and BIC if you have it) and any payment terms, so the invoice can be paid without a follow-up email.
-
Export the XML
When every required field is in, the export button unlocks. Download the XRechnung XML and a matching PDF — both generated in your browser.
Validating your XRechnung & common rejections
The exporter checks that the required fields are present and builds a structurally valid EN 16931 / XRechnung CII document. Before you send an important invoice, it's worth running the file through an official validator for a full compliance check.
Most rejections come down to a handful of avoidable mistakes:
- A missing or incorrect Leitweg-ID for a public-sector buyer.
- No buyer reference (order/PO number).
- A missing seller tax identifier (VAT ID or tax number).
- An incomplete address — often a missing country.
- A tax treatment that doesn't match the amounts (e.g. exempt but a VAT rate is still set).
Frequently asked questions
Is XRechnung the same as a PDF invoice?
No. A PDF is made for people to read; an XRechnung is a structured XML file made for software to read. The exporter gives you both — the XML to submit and a PDF to send alongside.
Do I need a VAT ID to create an XRechnung?
You need either a VAT ID or a tax number. If you're a §19 small business without a VAT ID, choose the small-business tax treatment and enter your tax number instead.
When do I need a Leitweg-ID?
Only when you're invoicing a German public authority. They provide the routing ID; use it exactly as given. For a normal business client, leave it blank.
Does this work for §19 Kleinunternehmer?
Yes. Choose the “small business, VAT-exempt (§19 UStG)” treatment and the invoice is built with the correct tax category and exemption note — no VAT rate required.
Is my data uploaded anywhere?
No. The XRechnung XML is assembled in your browser and downloaded from your device. Your invoice data is never sent to a server — ours or anyone's.
Is the file guaranteed to be accepted?
The exporter builds a structurally valid document covering the required fields, but it isn't a full validator. Run important invoices through the linked official validator before sending.