Leitweg-ID Validator & Check-Digit Calculator

Validate Leitweg-IDs, calculate check digits, and analyse segments — 100% in-browser, no data transmitted.

What Is a Leitweg-ID?

The Leitweg-ID (routing ID) is a unique identifier for public contracting authorities in Germany. It acts as the electronic address of a government agency and determines where a submitted XRechnung (e-invoice) is routed — similar to an IBAN in banking, but for e-invoices.

In the XRechnung context, the Leitweg-ID maps to business term BT-10 (Buyer Reference). Since 27 November 2020 it has been mandatory for all B2G (Business-to-Government) invoices submitted to federal authorities. Most German federal states have adopted equivalent obligations.

If the Leitweg-ID is missing or incorrect, the XRechnung validation fails with error BR-DE-15: "BT-10 (Buyer reference) is required". The authority's invoice system automatically rejects the invoice — one of the most common and costly invoicing mistakes in German public procurement.

A Leitweg-ID consists of a coarse address (numeric), an optional fine address (alphanumeric), and a two-digit check digit — all separated by hyphens. The check digit is computed using the ISO 7064 Mod 97-10 procedure, the same algorithm used for IBAN validation.

This tool validates complete Leitweg-IDs (including check-digit verification) and calculates the check digit for incomplete IDs — entirely locally in your browser with no data ever leaving your device.

How to Use the Leitweg-ID Validator

  1. ValidateSelect the "Validate" tab and enter a complete Leitweg-ID (e.g. 04011000-1234512345-06). Click "Validate" — the tool checks the format, allowed characters, and the correctness of the check digit.
  2. Calculate Check DigitKnow only the address body without the check digit? Switch to "Calculate Check Digit", enter the coarse address and optionally the fine address, and click "Calculate". You receive the complete Leitweg-ID including the computed check digit.
  3. Understand the SegmentsAfter each operation the tool shows a segment analysis: coarse address, fine address, and check digit are highlighted and explained individually.
  4. Bulk Validation (Pro)Pro users can validate any number of IDs at once in the "Bulk Validation" tab — as a list or CSV. Ideal for accounting workflows with many vendors.
  5. Copy the ResultCalculated check digits and full IDs can be copied to the clipboard with one click.

Tip: Letter case in the fine address is normalised automatically (letters are uppercased), as the specification allows only capital letters.

The ISO 7064 Mod 97-10 Algorithm

The Leitweg-ID check digit is computed using ISO/IEC 7064:2003, Mod 97-10 — the same procedure used for the International Bank Account Number (IBAN). The algorithm protects the address against common transcription errors such as swapped or mistyped digits.

Step-by-step calculation: (1) Concatenate the coarse and fine addresses (no hyphens) and append the placeholder "00". (2) Convert letters to numbers: A=10, B=11, … Z=35. (3) Divide the resulting large integer by 97 and take the remainder. (4) The check digit equals 98 minus that remainder, zero-padded to two digits. (5) Verification: the full digit string (address body + check digit, letters replaced) must be congruent to 1 modulo 97.

Because the numbers can be very large (up to 42+ digits), the modulo division is performed in JavaScript by processing the string in chunks — no BigInt required, since Number.MAX_SAFE_INTEGER is sufficient for blocks of up to 9 digits at a time.

Common Use Cases

Validate XRechnung Before Submission

Before submitting an XRechnung to a public authority, confirm that the Leitweg-ID in field BT-10 is correct and complete — avoiding costly rejections with error BR-DE-15.

Create New IDs

System developers and authority staff calculate the correct check digit for new Leitweg-IDs before storing them in ERP systems or invoice portals.

Ensure Data Quality in ERP Systems

Use the bulk validation (Pro) to check all stored Leitweg-IDs in a vendor master for correctness and fix erroneous entries before the next invoice run.

Training & Debugging

Developers and accountants can trace through the algorithm step by step — useful for debugging custom ERP implementations or onboarding new staff.

Worked Example

Given: coarse address 04011000, fine address 1234512345. Goal: compute the check digit.

Step 1 – Concatenate with placeholder:
  040110001234512345 + 00 = 04011000123451234500

Step 2 – No letters present (digits only)

Step 3 – Modulo 97:
  04011000123451234500 mod 97 = 92

Step 4 – Check digit:
  98 − 92 = 6 → zero-padded: 06

Result: 04011000-1234512345-06

Verification:
  040110001234512345 06 mod 97 = 1 ✓

Source: Leitweg-ID Formatspezifikation v2.0.2 (KoSIT / leitweg-id.de), ISO/IEC 7064:2003 Mod 97-10

Tips & Limitations

Tips

  • The Leitweg-ID can only be obtained from the public contracting authority — it cannot be invented independently. This tool checks format and check digit only, not whether an authority with this ID actually exists.
  • Letters in the fine address are automatically uppercased — entering "abc" will be treated as "ABC" during calculation.
  • A missing fine address is valid: the format <coarse>-<check> (with a single hyphen) is fully compliant.
  • Federal authority Leitweg-IDs often start with 991- (federal level). State authorities use state-specific prefixes (e.g. 04 for Lower Saxony).

Limitations

  • The tool checks syntax and check digit only, not whether the authority with this ID actually exists or is active.
  • Some authorities have internal routing rules in addition to the Leitweg-ID. The tool is not aware of these.
  • The check digit protects against transcription errors but does not guarantee the addressing is semantically correct.
  • Bulk validation is restricted to Pro users.

Frequently Asked Questions

Where do I find the Leitweg-ID of my contracting authority?

The Leitweg-ID is provided by the public contracting authority — typically in the purchase order, framework contract, or on the authority's invoice portal. At the federal level you can consult the Lieferantenportal des Bundes (LBB). You must not invent or guess the ID.

What happens if the Leitweg-ID in my XRechnung is missing or wrong?

The invoice fails the KOSIT Schematron validation with error BR-DE-15: "BT-10 (Buyer reference) is required in the context of (BR-DE-15)". The receiving invoice system automatically rejects it. You must correct the invoice and resubmit.

What is the difference between coarse address and fine address?

The coarse address (2–12 digits) identifies the authority at a high level, similar to a bank sort code. The fine address (optional, up to 30 alphanumeric characters) specifies the internal organisational unit, cost centre, or budget position — internal routing within the authority.

How does the Mod 97-10 algorithm handle letters in the fine address?

Letters are converted to two- or three-digit numbers according to a fixed scheme: A=10, B=11, C=12, … Z=35. So the letter "A" becomes "10" and "Z" becomes "35". The entire string is then treated as a large integer and divided modulo 97.

Why is the check digit always two digits?

The Mod 97-10 algorithm produces a result between 02 and 98. The result is always zero-padded to two digits (e.g. 6 → 06). The values 00, 01, and 99 cannot occur mathematically.

Which characters are allowed in a Leitweg-ID?

Coarse address: digits 0–9 only, 2–12 digits. Fine address: uppercase letters A–Z and digits 0–9, maximum 30 characters (lowercase is normalised automatically). Check digit: exactly 2 digits. Special characters, spaces, and German umlauts are not allowed.

What does BR-DE-15 mean in an XRechnung?

BR-DE-15 is a German business rule from the KoSIT XRechnung profile. It states that field BT-10 (Buyer Reference) must always be populated for B2G invoices (invoices to public authorities) — and in Germany this field is filled with the Leitweg-ID.

Can a Leitweg-ID be valid without a fine address?

Yes. The format <coarse>-<check> is fully valid — for example 991-01. Not every authority uses a fine address. The check digit is then computed over the coarse address alone.

Is this tool GDPR-compliant? Is my data stored?

Yes. The tool runs entirely in the browser (client-side). No entered Leitweg-ID is transmitted to a server or stored anywhere. Bulk validations (Pro) also remain local in your browser.

Related Tools