How to Convert a PDF Invoice to XRechnung XML

Germany's E-Rechnung mandate requires businesses to send structured electronic invoices for B2G (business-to-government) transactions, and B2B e-invoicing requirements are being phased in from 2025. XRechnung is the national standard — and if you already have PDF invoices, InvoicePeppol can convert them to compliant XRechnung XML in under a minute.

This guide is for businesses invoicing German public sector entities, companies preparing for Germany's B2B e-invoicing rollout, and anyone who needs to convert existing PDF invoices to XRechnung format without manual data entry.

Step-by-Step: Convert a PDF Invoice to XRechnung

  1. Sign up or log in to InvoicePeppol

    Create your free account at InvoicePeppol using email or Google login. Free accounts include a monthly conversion allowance — no payment details required to get started.

  2. Upload your PDF invoice

    Navigate to the PDF converter and upload your invoice. The system handles both text-based PDFs (exported from tools like DATEV, Lexware, or SAP) and scanned documents. Text-based PDFs deliver the best accuracy.

  3. AI extracts your invoice data

    The AI reads your PDF and pulls out all relevant fields: seller and buyer details, invoice number, dates, line items with quantities and unit prices, VAT breakdowns, and payment information. For German invoices, it also identifies fields critical to XRechnung compliance like the Leitweg-ID and Buyer Reference.

  4. Review and complete the extracted data

    Check every section of the extracted data. Pay special attention to the Leitweg-ID (the routing identifier for your government buyer — this is mandatory for B2G invoices), the Buyer Reference (Bestellnummer), and VAT identification numbers. XRechnung has stricter validation rules than generic Peppol, so completeness matters.

  5. Select XRechnung as the output format

    Choose XRechnung from the available output formats. InvoicePeppol generates XRechnung-compliant UBL 2.1 XML that conforms to the XRechnung CIUS (Core Invoice Usage Specification) on top of EN 16931.

  6. Download your XRechnung XML

    Your validated XRechnung XML is generated instantly. Download it and upload it to your government buyer's invoice portal (such as ZRE — Zentrale Rechnungseingangsplattform for federal agencies, or OZG-RE for state-level portals), or transmit it via Peppol.

Tips for XRechnung Compliance

  • Always include the Leitweg-ID. This is the most common reason XRechnung invoices are rejected. The Leitweg-ID is a routing number assigned to the government buyer — ask your contracting authority for it before invoicing. The format is typically numeric with hyphens (e.g., 991-12345-67).
  • Fill in the Buyer Reference (BT-10) field. XRechnung requires a buyer reference — usually a purchase order number or contract reference. If the buyer hasn't provided one, the Leitweg-ID can serve as the buyer reference, but check with your buyer first.
  • Use the correct German VAT number format. German USt-IdNr. follows the format DE123456789 (DE + 9 digits). The Steuernummer (tax number) is different and uses a format like 12/345/67890. XRechnung requires the USt-IdNr. for cross-border transactions.
  • Verify your IBAN and BIC. German government portals validate payment details strictly. Ensure your bank account information is correct and formatted properly — IBAN for German accounts starts with DE followed by 20 characters.

What's in the Output XML?

XRechnung is Germany's national implementation of the EN 16931 European e-invoicing standard. The XML file InvoicePeppol generates uses UBL 2.1 syntax and includes all fields mandated by the XRechnung specification (currently version 3.0.x):

  • Invoice metadata — invoice number, issue date, due date, currency (typically EUR), and the XRechnung customization ID that identifies the document as XRechnung-compliant
  • Buyer Reference (BT-10) — the mandatory reference field, usually a purchase order number or Leitweg-ID
  • Seller details — legal name, postal address, VAT identification number (USt-IdNr.), and contact information
  • Buyer details — government entity name, address, and the Leitweg-ID as the routing identifier
  • Payment information — payment method, IBAN, BIC, and payment terms including any early payment discounts (Skonto)
  • Tax breakdown — VAT amounts per rate (19% standard, 7% reduced, or 0% for exempt/reverse-charge)
  • Line items — each product or service with description, quantity, unit, unit price, and applicable VAT category
  • Totals — line extension amount, tax exclusive amount, tax amount, and payable amount

The generated XML passes both UBL 2.1 schema validation and the XRechnung Schematron rules, which enforce Germany-specific requirements beyond what generic EN 16931 demands.

Next Steps

Explore these related resources to deepen your understanding of XRechnung and German e-invoicing:

  • XRechnung Format Guide — full technical overview of the XRechnung specification, validation rules, and version history
  • Germany E-Invoicing Guide — the complete picture of Germany's B2G and B2B e-invoicing mandates, timelines, and compliance requirements
  • Peppol BIS 3.0 Guide — XRechnung invoices can be transmitted via Peppol; learn how the two standards relate
  • ZUGFeRD Format Guide — if you need a hybrid PDF/XML format that's also accepted in Germany

Frequently Asked Questions

What is a Leitweg-ID and where do I find it?

The Leitweg-ID is a routing identifier assigned to German government entities to direct incoming e-invoices to the correct department. It's mandatory for all B2G XRechnung invoices. Your contracting authority should provide it — it's typically included in the purchase order or contract. The format is a series of numbers separated by hyphens, such as 991-12345-67. Without it, your invoice will be rejected by government portals.

Is XRechnung the same as Peppol BIS 3.0?

No, but they're closely related. Both comply with EN 16931, and both can use UBL 2.1 syntax. XRechnung is a German CIUS (Core Invoice Usage Specification) that adds stricter requirements — for example, the mandatory Buyer Reference field and specific German validation rules. A valid XRechnung invoice can be sent over the Peppol network, but a generic Peppol BIS 3.0 invoice may not meet all XRechnung requirements.

Can I use XRechnung for B2B invoices in Germany?

Yes. While XRechnung was originally designed for B2G, Germany's B2B e-invoicing mandate (being phased in from 2025) accepts XRechnung as a compliant format. It's one of the recommended formats alongside ZUGFeRD for the B2B mandate. Using XRechnung for B2B invoices means you're already prepared for full compliance.

Which portal do I upload XRechnung invoices to?

It depends on the level of government. For federal agencies, use the ZRE (Zentrale Rechnungseingangsplattform) at xrechnung.bund.de. For state and municipal entities, many states operate their own portals (e.g., OZG-RE). Some government buyers also accept XRechnung via Peppol or email. Your contracting authority should specify which submission channel to use.

Ready to convert your invoices?

InvoicePeppol converts your PDF invoices to compliant e-invoicing XML in seconds. AI-powered extraction, manual review, and instant download.