XRechnung is Germany's national electronic invoice standard, established to fulfill the European Union's requirement for machine-readable, structured electronic invoices in public procurement. If your business invoices any German federal, state, or municipal authority, understanding XRechnung is not optional — it is a legal requirement.
This guide explains what XRechnung is, who is required to use it, how it is structured, and what you need to create compliant invoices in 2025 and beyond. Whether you are a freelancer, a small business owner, or a finance professional managing hundreds of invoices per month, this article gives you the complete picture.
What Is XRechnung?
XRechnung is a structured XML data format for electronic invoices. Unlike a PDF invoice — which is essentially a scanned image of a document — an XRechnung file contains machine-readable, structured data that can be automatically processed by an ERP system or government accounting software without any manual data entry.
The standard was created by KoSIT (Koordinierungsstelle für IT-Standards) and is based on the European standard EN 16931, which defines a core invoice model for all EU member states. Germany chose to implement this standard as XRechnung, using two underlying XML syntaxes: UBL (Universal Business Language) and CII (Cross Industry Invoice). Both syntaxes are legally valid and represent the same invoice data in slightly different XML formats.
The Legal Basis for XRechnung
The mandatory use of XRechnung in Germany is grounded in the following legal framework:
- EU Directive 2014/55/EU on electronic invoicing in public procurement, which requires EU member states to accept structured electronic invoices.
- The German E-Rechnungsverordnung (ERechV), which took effect on November 27, 2019, mandating electronic invoicing for federal suppliers.
- Individual state-level regulations (Landesverordnungen) extending this requirement to state and municipal authorities.
- From 2025 onwards, expanded B2B requirements under the German Growth Opportunities Act (Wachstumschancengesetz).
Who Must Use XRechnung?
The mandatory use of XRechnung currently applies in the following scenarios:
- B2G (Business to Government): Any supplier invoicing a German federal agency (Bundesbehörde) above €1,000 must submit invoices via XRechnung through the central invoice platform (ZRE for federal, OZG-RE for states).
- State and Municipal Procurement: Individual German states have adopted their own e-invoicing mandates, most of which also require XRechnung or accept it as a compliant format.
- B2B (Business to Business): Starting January 1, 2025, Germany mandates that all domestic B2B transactions must use a structured electronic invoice format. XRechnung is the primary compliant format for this requirement.
The Structure of an XRechnung File
An XRechnung file is an XML document organized into a strict hierarchy of business terms (BTs) and business groups (BGs) as defined by EN 16931. The key sections include:
- Process and Invoice Identifiers (BT-1 to BT-7): Invoice number, issue date, due date, and currency.
- Seller Information (BG-4): Seller name, address, contact details, and tax registration numbers.
- Buyer Information (BG-7): Buyer identification, including the mandatory Leitweg-ID for public sector invoices.
- Delivery Information (BG-13): Optional delivery address and date.
- Payment Terms (BG-16): Payment means, IBAN, BIC, and due date.
- Tax Information (BG-23): VAT category, tax rate, taxable amount, and calculated tax amount.
- Line Items (BG-25): Individual invoice lines with quantity, unit price, description, and net amount.
- Document Level Totals (BG-22): Sum of line amounts, total tax amount, and payable amount.
UBL vs. CII: Which Syntax Should You Use?
XRechnung supports two XML syntaxes for representing invoice data: UBL (OASIS Universal Business Language) and CII (UN/CEFACT Cross Industry Invoice). Both syntaxes carry the same semantic content — they are simply different XML representations of the same underlying EN 16931 invoice model.
UBL is the more widely used syntax in German public procurement and is the default format for most XRechnung tools and the ZRE submission portal. CII is the syntax used by ZUGFeRD (the hybrid PDF/XML format for B2B invoices). Unless your software specifically generates CII, using UBL is the safe choice for B2G submissions.
The Leitweg-ID: Essential for B2G Invoices
Every XRechnung sent to a German government authority must include the Leitweg-ID (routing ID) in business term BT-10. This identifier tells the invoice routing infrastructure which department, cost center, or processing system should receive and process the invoice. Without a valid Leitweg-ID, an XRechnung will be rejected by KOSIT validation.
The Leitweg-ID is assigned by the receiving authority and typically follows the format: [area code]-[institution code]-[check digit], for example "04011000-1234512345-06". Always obtain the correct Leitweg-ID from your contracting authority before submitting an invoice.
How to Validate an XRechnung
KOSIT (Koordinierungsstelle für IT-Standards) provides official validation rules for XRechnung. A valid XRechnung must pass:
- XML well-formedness check: The document must be syntactically valid XML.
- Schema validation: The document must conform to the UBL or CII schema.
- Schematron validation: Business rules (BR-DE-1 through BR-DE-*) defined by KOSIT must be satisfied.
- EN 16931 core validation: European core invoice model rules must also be met.
Our XRechnung Viewer tool runs all of these validation checks in your browser and provides detailed error messages with remediation guidance for every failed rule.
Submitting XRechnung Invoices
Federal invoices are submitted via Germany's Zentrale Rechnungseingangsplattform (ZRE) at xrechnung.bund.de. State invoices may use OZG-RE or state-specific portals. Most modern accounting software (DATEV, SAP, Lexware, Sage) can generate and submit XRechnung directly. If your software does not support XRechnung, our generator tool allows you to create compliant invoices from scratch.
Common Mistakes When Creating XRechnung
- Missing Leitweg-ID (BT-10) — required for all B2G invoices.
- Missing seller VAT ID (BT-31) — required even if the seller is not VAT-registered (use a special tax exemption code instead).
- Incorrect VAT calculation — the calculated tax amount must exactly equal taxable amount × tax rate.
- Sum mismatch — the sum of line net amounts must equal the document total net amount (BT-106).
- Wrong currency codes — use ISO 4217 three-letter codes (EUR, not €).
- Missing mandatory contact details (BT-41, BT-42, BT-43).
Frequently Asked Questions
Is XRechnung the same as an e-invoice?
Not exactly. An e-invoice is a broad term covering any digitally transmitted invoice, including PDFs sent by email. XRechnung specifically refers to a structured XML invoice that conforms to the EN 16931 standard. A PDF is not an XRechnung.
Can I send XRechnung to private companies?
Yes. While XRechnung is mandatory for B2G, it is also valid for B2B use. Starting from 2025, German B2B invoicing requires structured electronic formats — XRechnung is the primary compliant option for domestic B2B transactions.
What software can create XRechnung?
DATEV, SAP, Lexware, Sage, and many cloud accounting tools support XRechnung generation. For smaller businesses and freelancers, our free XRechnung Generator creates compliant UBL XML files directly in your browser without any software installation.
Is XRechnung stored on your servers?
No. Our XRechnung Viewer and Generator process all invoice data client-side in your browser. Your invoice content is never transmitted to our servers unless you explicitly use the GoBD Vault feature.