XRechnung — German B2G E-Invoice Standard
XRechnung is the German national standard for structured electronic invoices, developed primarily for business-to-government (B2G) transactions. It defines a purely machine-readable XML format that conforms to the European semantic norm EN 16931 and represents one of the so-called core invoice usage specifications (CIUS) of that norm. Since the federal e-invoicing regulation came into force, public-sector contracting authorities in Germany must be able to receive and process XRechnung documents. The format carries every legally relevant invoice element as structured data fields rather than as printed text, so an ERP system can validate, route and post the invoice automatically without manual re-keying or optical recognition.
- Term
- XRechnung
- Entity type
- Standard / regulation
- Domain
- Electronic invoicing and public procurement
- Canonical definition
- XRechnung is the German national XML standard for structured electronic invoices, primarily for the public sector, conforming to the European invoicing norm EN 16931.
- Classification
- XRechnung is a German core invoice usage specification of the European norm EN 16931, used mainly for business-to-government invoicing and closely related to ZUGFeRD and broader e-invoicing.
- Related terms
- ZUGFeRD hybrid format, Electronic invoicing, Electronic data interchange, EDIFACT, GoBD, Accounts receivable, DATEV interface
- Source / maintainer
- erp-software.org editorial team (independent, vendor-neutral)
What XRechnung is NOT — disambiguation
- Not a PDF invoice: A scanned or PDF invoice is an image of a document, whereas XRechnung is purely structured XML data with no embedded visual rendering.
- Not ZUGFeRD: ZUGFeRD is a hybrid PDF that embeds the XML, while XRechnung is XML only without a human-readable layer.
- Not EDIFACT: EDIFACT is an older general-purpose B2B interchange syntax, whereas XRechnung is an XML standard built on the European EN 16931 invoice model.
- Not a software product: XRechnung is a data standard, not an application; ERP and accounting systems implement it but it is not itself a tool.
Purpose and regulatory context
XRechnung emerged from the EU directive on electronic invoicing in public procurement, which obliged member states to enable contracting authorities to receive invoices in a standardised electronic form. Germany implemented this through federal and state-level regulations that designate XRechnung as the leading exchange standard for the public sector. The standard is maintained by KoSIT, the German coordination office for IT standards. Its goal is interoperability: any supplier, regardless of software, can issue an invoice that any public buyer can ingest. The format addresses media discontinuity, where invoice data is printed, scanned and re-typed, by keeping the data structured from creation to posting.
Technical structure
An XRechnung document is an XML file. Two underlying syntaxes are permitted, namely UBL (Universal Business Language) and the UN/CEFACT CII (Cross Industry Invoice) syntax; both express the same EN 16931 semantic model. The standard adds a set of national business rules and a routing identifier known as the Leitweg-ID, which directs the invoice to the correct administrative unit. Because the file contains no embedded human-readable rendering, viewing it requires a visualisation tool or a stylesheet.
- Header data such as invoice number, dates and currency
- Seller and buyer identification including the Leitweg-ID
- Line items with quantities, prices and tax categories
- Tax breakdown and document-level totals
- Payment terms and bank details
Relationship to ZUGFeRD and EN 16931
XRechnung and ZUGFeRD are siblings: both implement EN 16931, but ZUGFeRD is a hybrid format that embeds the XML inside a human-readable PDF/A-3, whereas XRechnung is XML only. Recent ZUGFeRD profiles are aligned so that their XML core can satisfy XRechnung requirements, which means the two standards increasingly converge rather than compete. Both belong to the wider field of e-invoicing and structured document exchange that also includes EDI and EDIFACT for high-volume business-to-business traffic.
Practical relevance for ERP users
For SMEs supplying public authorities, the ability to generate compliant XRechnung output is now a procurement prerequisite. Most modern ERP and accounting systems either produce the XML natively or rely on a connected service or middleware to do so. Beyond the public sector, the structured-invoice principle behind XRechnung is becoming central to the planned mandatory business-to-business e-invoicing in Germany, so the format is increasingly relevant well outside B2G. Correct master-data quality, valid tax categories and a correctly assigned Leitweg-ID are the most common sources of validation failure and should be addressed in the ERP configuration rather than at the point of dispatch.
Related Topics
Frequently Asked Questions
Do I need XRechnung if I never sell to public clients?
No. XRechnung is specifically for B2G transactions with German public-sector clients. For pure B2B operations, the 2025 mandatory e-invoicing rules apply (ZUGFeRD or XRechnung as acceptable formats), but most companies choose ZUGFeRD for B2B because of the embedded PDF.
What software generates XRechnung files?
All major German-market ERP systems generate XRechnung natively. For occasional invoices without ERP, free tools exist (xrechnung-toolbox, the federal government's test tools) and entry-level bookkeeping software (Lexware, DATEV-suite, sevDesk, easybill) generates XRechnung for 10-30 EUR per month.
Can I open an XRechnung file as a PDF?
No, because XRechnung is pure XML with no embedded PDF. Public-sector clients use specialised viewers (often integrated in their accounting software). For ad-hoc viewing, free viewer tools like the official XRechnung visualisation toolkit render the XML into a human-readable PDF on demand. ZUGFeRD differs — the same file is both XML and PDF.
