XRechnung & Leitweg-ID Validator (Germany)
Validate format, federal state prefixes, and ISO 7064 checksum for Leitweg-IDs and XRechnung XML invoices.
How does validation work?
XRechnung is the mandatory German electronic invoicing standard (XML UBL/CII) regulated by KoSIT for B2G and B2B procurement.
The Leitweg-ID is the routing identifier in format [StatePrefix]-[SubEntity]-[2-digit CheckDigit] that routes the invoice to the recipient authority.
Anatomy & Structure of Leitweg-ID (XRechnung / KoSIT)
The Leitweg-ID is the mandatory public electronic invoicing routing address in Germany:
| Position | Field | Length | Meaning & KoSIT Specification | Example |
|---|---|---|---|---|
| 1 to 4 | Jurisdiction / Bundesland | 2-4 chars | Federal state code ('04011000' for Federal Bund administration, '09' for Bavaria, etc.). | 04011000 |
| Middle | Subentity ID | up to 10 chars | Public administration department or municipality receiving the invoice. | 12345 |
| End | Checksum Digits | 2 digits | Check digits computed per ISO 7064 Modulo 97-10. | 38 |
ISO 7064 Modulo 97-10 Checksum Algorithm
Leitweg-ID routing integrity is secured using the international standard ISO 7064:
Checksum = 98 - (BigInt(NumericString) % 97)
- 1. Block Concatenation: combine the federal state prefix with the subentity ID.
- 2. Alphanumeric Transliteration: convert letters into numeric equivalents (A=10 through Z=35) and append '00' at the end.
- 3. Modulo 97: compute the remainder of dividing the integer by 97.
- 4. Complement 98: subtract the remainder from 98. The 2-digit zero-padded result is the checksum.