How to Create an XRechnung Invoice: Step-by-Step Guide 2026

Happy Diana, Chief Hapiness Officer

Diana

MSc Corporate Finance

MSc Corporate Finance

Updated on:

creating Xrechnung invoices

What Is an XRechnung?

XRechnung is Germany's national standard for structured electronic invoices — a pure XML format with no human-readable PDF layer. It's based on the European standard EN 16931 and is designed to be processed automatically by accounting and ERP systems. If you invoice German federal authorities, XRechnung (or its hybrid cousin ZUGFeRD) has been mandatory since 2020. And with Germany's B2B e-invoicing rollout underway, it's quickly becoming the default format for business-to-business invoicing too.

The format comes in two technical flavors: XRechnung-UBL (Universal Business Language) and XRechnung-CII (Cross-Industry Invoice). Both comply with the same standard — which one you use depends on what your software supports.


Who Needs to Use XRechnung?

The mandate rolls out in two stages:

  • B2G (Business to Government): Invoices to German federal authorities have required XRechnung or ZUGFeRD since November 2020. Most German states and municipalities are following by the end of 2025.

  • B2B (Business to Business): From 1 January 2025, all German businesses must be able to receive structured e-invoices. The obligation to send them kicks in from 1 January 2027 for companies with more than €800,000 annual turnover, and from 1 January 2028 for everyone else.

Small businesses (Kleinunternehmer, §19 UStG) are initially exempt from the sending obligation but must still be able to receive e-invoices. For the full legal background, see our article on Germany's e-invoicing mandate 2026.

Create XRechnung invoices in minutes — without touching XML

Norman generates XRechnung and ZUGFeRD invoices automatically when you create an invoice. No XML editing, no separate validator step required.

Try Norman free →


Step-by-Step: How to Create an XRechnung

Step 1: Get the Leitwegsnummer from your client

For invoices to public-sector buyers, you need the Leitwegsnummer — a routing identifier that tells the government's invoice portal exactly which department should receive your invoice. Without it, the invoice will be rejected outright. Ask your contact at the public authority before you start filling in anything else. For B2B invoices, this field doesn't apply.

Step 2: Gather the required fields

Before opening your software, get all the mandatory data ready. Missing fields cause validation failures:

Required field

Example

Invoice number (unique)

INV-2026-042

Invoice date

2026-04-20

Due date / payment terms

2026-05-04

Seller: name, address

Jane Smith, Musterstraße 1, 10115 Berlin

Seller: tax number or VAT ID

DE123456789

Buyer: name, address

Federal Ministry of XY

Leitwegsnummer (B2G only)

991-1234512345-06

Line items: description, qty, unit price, VAT rate

Consulting, 8h, €100, 19%

Net amount, VAT amount, gross amount

€800, €152, €952

Payment details: IBAN, BIC

DE89 3704 0044 0532 0130 00

Step 3: Choose XRechnung or ZUGFeRD?

If your client needs a human-readable document — or you want to keep a PDF copy for your own records — ZUGFeRD is the better choice. It embeds the same XML data inside a regular PDF. Most public authorities accept both. For a detailed comparison, see our article on XRechnung vs. ZUGFeRD.

Step 4: Create the invoice in software

The simplest route is invoicing or accounting software that natively supports XRechnung. You fill in the invoice details as normal — the software generates the XML in the background and ensures all mandatory fields are populated correctly.

For occasional use, the free KoSIT XRechnung generator (from the German standardization body) lets you manually enter data and produces valid XML without any coding. For developers, libraries like mustangproject (Java) handle the XML generation programmatically.

Step 5: Validate the invoice

Before sending, run your file through the official KoSIT validator (validator.kosit.de). It checks:

  • Technical XML well-formedness

  • Compliance with EN 16931 mandatory fields

  • German CIUS (Core Invoice Usage Specification) rules

Good accounting software validates internally so you never produce an invalid file. If you're using a manual generator, this step is non-negotiable.

Step 6: Transmit the invoice

How you send the invoice depends on the recipient:

  • Federal authorities: Via the OZG-RE portal (Onlinezugangsgesetz-Rechnungseingangsportal) or the PEPPOL network

  • State and municipal authorities: Via the relevant state portal (ZRE for federal suppliers; state-specific portals for Bavaria, NRW, etc.)

  • B2B recipients: By email as a .xml attachment, or via PEPPOL if your client is connected


Creating XRechnung with Software: What to Look For

For anyone invoicing regularly, dedicated software pays for itself quickly in time saved and errors avoided. For a side-by-side comparison of Lexoffice, sevDesk, FastBill, and Norman, see our e-invoicing software comparison. Quick summary:

Software

XRechnung

ZUGFeRD

Built-in validator

Norman

Lexoffice

Partial

sevDesk

Partial

KoSIT Generator (free)

Manual

Norman's invoicing feature generates XRechnung and ZUGFeRD automatically — no separate export step, no manual validator. You create the invoice as usual; the compliant XML file is generated in the background.


Common Mistakes When Creating XRechnung

Wrong or missing Leitwegsnummer

The most common reason for rejection on B2G invoices. The Leitwegsnummer must match exactly what the contracting authority provided — no extra spaces, no modified formatting.

Incorrect tax identification

XRechnung requires either your Steuernummer (German tax number in your state's format) or your Umsatzsteuer-Identifikationsnummer (VAT ID). These are different numbers serving different purposes.

Wrong VAT codes

XRechnung uses standardized UNCL5305 codes for VAT treatment: S for standard rate (19%), R for reduced rate (7%), Z for zero-rate, AE for reverse charge. If your software maps these incorrectly, validation will fail.

Wrong date format

XRechnung requires dates in ISO 8601 format (YYYY-MM-DD). The German format (20.04.2026) is rejected. Software handles this for you — only an issue if you're editing XML manually.

Missing bank details

IBAN is not optional in XRechnung — an invoice without payment details is considered incomplete and will fail validation.


XRechnung for Small Businesses (Kleinunternehmer)

If you're a Kleinunternehmer under §19 UStG, you don't charge VAT. In XRechnung, you still include a VAT category code — use E (Exempt from tax), the official UNCL5305 code for tax-exempt supplies. Add the exemption reason in the free-text field BT-120: "Steuerbefreit gemäß §19 UStG". The VATEX code field (BT-121) stays empty for purely national exemptions — there's no dedicated EU VATEX code for Germany's Kleinunternehmer rule. Software with a Kleinunternehmer mode fills these fields in automatically.


Conclusion

Creating an XRechnung isn't complicated once you know what's required. For occasional B2G invoices, the free KoSIT generator does the job. For regular invoicing, software that integrates XRechnung generation, validation, and submission in one step saves significant time and eliminates errors. If you're still comparing tools, our Norman vs. Lexoffice comparison shows how the two approaches differ for freelancers and small businesses.

Do you have a tax question?

Get a free email answer from our tax coaches.

Norman never provides financial, legal, or tax advice.

Norman never provides financial, legal, or tax advice.

Made in Germany

Berlin based

GDPR-compliant

Hosted in Germany

© 2026 Norman AI GmbH

Made in Germany

Berlin based

GDPR-compliant

Hosted in Germany

© 2026 Norman AI GmbH