Leitweg-ID

Leitweg-ID: structure, check digit, and the errors it causes

The Leitweg-ID is the address an invoice to a German public authority is routed to. It has a fixed format with a check digit — this page covers how it is built, where your ID comes from, and what goes wrong when a digit slips.

Check your Leitweg-ID

Structure, character set and check digit against format specification 2.0.2. The check runs in the browser.

The check runs in your browser. The ID you type never leaves the device.

What the Leitweg-ID is

Anyone invoicing a German public authority electronically does not send the invoice to an email address but to an invoice reception portal that sits in front of hundreds or thousands of offices. The Leitweg-ID tells the portal which one is meant. It is an address, not an identifier of your company and not a tax number.

It is registered as its own scheme under ISO/IEC 6523 and travels in an XRechnung in the buyer reference field (BT-10) — in UBL as cbc:BuyerReference, in CII as ram:BuyerReference. Which is exactly why this page exists: the most common German rejection hangs on that one field.

Where your Leitweg-ID comes from

From the recipient. There is no public directory in which you can look up your customer’s Leitweg-ID — the authority issues it and has to tell you, normally in the purchase order, in the contract, or on request from the office that ordered.

This is where most of the time goes. A Leitweg-ID cannot be computed and cannot be guessed: the fine addressing behind the coarse addressing is assigned by each state and each federal body under its own scheme, and one authority may run different IDs for different offices or procedures. So ask for the ID for this particular order, not for “the city’s ID”.

A checker like the one on this page can tell you an ID is formally sound. Whether it belongs to your recipient is something only you and the recipient know — that mapping is in no register anyone outside can read.

How it is built

Three parts, separated by hyphen-minus: coarse addressing, optional fine addressing, two check digits. Between 5 and 46 characters in total.

04011000-1234512345-06

Coarse addressing: 2 to 12 digits

Numeric only, assembled from four elements, each of which may be left out only if every element after it is left out too:

DigitsMeaning
2State, or federal, code
1Regierungsbezirk (required once a district follows)
2District (required once a municipality follows)
3, 4 oder 7Municipal association and/or municipality

One consequence is worth stating because no document states it outright: a coarse addressing can only be 2, 3, 5, 8, 9 or 12 digits long. Four or six digits cannot be assembled from that table — if you see them, a digit has gone missing.

The first two digits

01 Schleswig-Holstein

02 Hamburg

03 Niedersachsen

04 Bremen

05 Nordrhein-Westfalen

06 Hessen

07 Rheinland-Pfalz

08 Baden-Württemberg

09 Bayern

10 Saarland

11 Berlin

12 Brandenburg

13 Mecklenburg-Vorpommern

14 Sachsen

15 Sachsen-Anhalt

16 Thüringen

99 Bund

Fine addressing: optional, up to 30 characters

Letters A–Z (not case-sensitive) and digits 0–9. Federal and state bodies fill it as they like, so it carries no meaning derivable from outside the authority itself. The specification recommends starting it with a letter — the reason is in the check digit section below.

Check digits: two digits

Computed under ISO/IEC 7064:2003, method MOD 97-10 — the same one an IBAN uses. It is not free to choose: it follows from the coarse and fine addressing.

  1. Concatenate coarse and fine addressing without the hyphens: 040110001234512345
  2. Replace letters with their position in the alphabet, A = 10 through Z = 35. (There are none in the example.)
  3. Append two zeroes: 04011000123451234500
  4. Take it modulo 97: remainder 92.
  5. Subtract the remainder from 98: 98 − 92 = 06. A single-digit result is written with a leading zero.

Checking is one step: the full ID, hyphens removed and letters translated, must give 1 modulo 97.

The mistakes that actually happen

The wrong hyphen
Copied out of a Word document or a PDF, the separator is often an en dash (–) or a non-breaking hyphen rather than the hyphen-minus U+002D the specification requires. The ID looks right and is refused. The checker above names the character and shows the corrected form.
The hyphen one position out
Because the hyphen is left out of the check digit, 04011000-1234512345 and 040110001-234512345 carry the same check digit. The check digit cannot see that error — which is why the specification recommends starting the fine addressing with a letter: the misplaced hyphen then puts a letter into the numeric-only coarse addressing, where it is obvious.
Transposed digits
Exactly what the check digit is for. When the checker expects a different check digit from the one given, usually it is not the check digit that was copied wrongly but a digit before it.
Spaces and invisible characters
Leading and trailing spaces from the clipboard, or spaces around the hyphens because the ID sat in a sentence. To the receiving system that is a different value.
The ID is missing entirely
That is no longer a format problem but BR-DE-15 — the rule that reports a missing buyer reference.

Check the whole invoice

A well-formed Leitweg-ID is one of some 300 rules. The validator checks the complete invoice against the official KoSIT rule set and explains every finding in plain language.

Source: Leitweg-ID Format-Spezifikation 2.0.2, Koordinierungsstelle für IT-Standards, version of 28 July 2021. This page restates the rules laid down there; the specification governs.