Generator · German data

German USt-IdNr

Endpoint GET /v1/de/ust-idnr

What it covers

Returns a valid German USt-IdNr (VAT identification number) with a correct ISO 7064 MOD 11,10 check digit. Use `format=national` for the bare nine-digit core. Set `invalid=true` for a number with a deliberately wrong check digit.

How it’s calculated

The German USt-IdNr (EU VAT number) appends a single ISO/IEC 7064 MOD 11,10 check digit computed by a pure recursive recurrence over the first eight payload digits.

Algorithm

  1. Take the eight payload digits in order (the first is 1-9, never 0; the remaining seven are 0-9). The ninth digit will be the check digit.
  2. Initialise a running value called `product` to 10.
  3. For each payload digit d, left to right: compute sum = (d + product) mod 10.
  4. If that sum is 0, replace it with 10 (i.e. map a 0 result to 10).
  5. Update product = (sum * 2) mod 11.
  6. After all eight digits have been processed, compute the check digit as checkDigit = (11 - product) mod 10.
  7. This always yields a single decimal digit 0-9 (no unrepresentable residue, never a redraw). Append it as the ninth digit.
  8. The national core is the eight payload digits followed by the check digit. The VAT form prefixes the literal 'DE' (format 'national' returns the bare nine digits).

Worked example

USt-IdNr with payload 13579246 and check digit ? (DE13579246?)

Start product = 10.
d=1: sum=(1+10) mod 10 = 1; sum!=0; product=(1*2) mod 11 = 2
d=3: sum=(3+2) mod 10 = 5; product=(5*2) mod 11 = 10
d=5: sum=(5+10) mod 10 = 5; product=(5*2) mod 11 = 10
d=7: sum=(7+10) mod 10 = 7; product=(7*2) mod 11 = 14 mod 11 = 3
d=9: sum=(9+3) mod 10 = 2; product=(2*2) mod 11 = 4
d=2: sum=(2+4) mod 10 = 6; product=(6*2) mod 11 = 12 mod 11 = 1
d=4: sum=(4+1) mod 10 = 5; product=(5*2) mod 11 = 10
d=6: sum=(6+10) mod 10 = 6; product=(6*2) mod 11 = 12 mod 11 = 1
checkDigit = (11 - 1) mod 10 = 10 mod 10 = 0

The check digit is 0, giving national core 135792460 and VAT number DE135792460.

Edge cases

  • A check digit of 0 is valid and occurs (the `zero-check-digit` edge class generates cores whose ninth digit is 0), so naive filters assuming a non-zero trailing digit will wrongly reject valid numbers.
  • The first payload digit is always 1-9 (never 0); the smallest legal leading digit is 1 (the `leading-small` edge class exercises exactly this).

Gotchas

  • This is ISO 7064 MOD 11,10 (a pure recursive recurrence), NOT a weighted-sum mod-11 scheme — do not confuse it with the mod11.ts primitive. The recurrence maps an intermediate sum of 0 to 10 before doubling mod 11.
  • Because the system always produces a single decimal digit, there is never a 'residue 10 / redraw' case as with plain mod-11 identifiers.
  • The generator's value is synthetic: the check digit is mathematically valid but the number is not guaranteed to belong to a registered business.

Parameters

ParameterTypeDescription
countinteger1–1000Number of records to return, 1–1000 (your plan may lower this). Omitted returns a single record; set it for a batch.
edgebooleanRestrict output to valid edge-case USt-IdNrs from the rare corners.
extremebooleanReturn a correct value wrapped in a hostile encoding (untrimmed whitespace, invisible/zero-width characters, BOM, or bidi/combining marks). Homoglyphs are excluded so the value stays machine-parseable; it still validates after normalisation.
format"national" | "vat"Rendering: bare nine-digit national core, or DE-prefixed VAT number (default).
invalidbooleanReturn a USt-IdNr with a deliberately wrong ISO 7064 check digit.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.

Response fields

FieldTypeDescription
valuestringThe USt-IdNr in the requested format (VAT or national).
digitsstringThe canonical, unprefixed nine-digit core.

Other generators for Germany

See all generators for Germany →

The same kind of identifier elsewhere

Try it

Generate a live example below — every response is valid by format and entirely synthetic.