Generator · Belgian data

Belgian Ondernemingsnummer

Endpoint GET /v1/be/ondernemingsnummer

What it covers

Returns a valid Belgian Ondernemingsnummer (enterprise number) with a correct `97 − (first8 mod 97)` check. Use `format=vat` for the BE VAT number. Set `invalid=true` for a number with a deliberately wrong check.

How it’s calculated

The Belgian enterprise number's two trailing check digits are 97 minus the first eight digits taken modulo 97, zero-padded to two digits.

Algorithm

  1. Take the first 8 digits of the enterprise number (the payload). The registry only issues numbers whose first digit is 0 or 1, but the checksum treats all 8 as a plain number.
  2. Interpret those 8 digits as a base-10 integer (leading zeros kept as part of the string but numerically dropped).
  3. Compute r = payload mod 97 using ordinary integer modulo (the code uses BigInt % 97n).
  4. Compute check = 97 - r. This yields a value in the range 1..97.
  5. Zero-pad check to exactly two digits (padStart(2, '0')). This is the two-digit check field.
  6. The full 10-digit enterprise number is the 8 payload digits followed by these two check digits.

Worked example

Enterprise number 04203040?? (first 8 digits 04203040, check digits unknown)

Payload = first 8 digits = 04203040, i.e. the integer 4203040.
Compute 4203040 mod 97: 97 × 43330 = 4203010, and 4203040 − 4203010 = 30, so r = 30.
check = 97 − r = 97 − 30 = 67.
67 is already two digits, so no zero-padding is needed; check field = '67'.
Full number = 04203040 followed by 67 = 0420304067.

The check digits are 67, giving the full enterprise number 0420304067.

Edge cases

  • Leading digit is only ever 0 or 1 — the only issuance blocks the Belgian registry uses; a numeric parse of a 0-leading number silently drops to nine digits.
  • Because check = 97 - (n mod 97) lies in 1..97, every 8-digit prefix yields a valid two-digit check, so no prefix is 'dead' and no redraw is ever needed (unlike mod-11 schemes).
  • A check value of 00 is unreachable (it would require 97 - (n mod 97) = 0, i.e. n mod 97 = 97, which is impossible); the smallest possible check is 01.

Gotchas

  • The modulus is applied to the payload directly (n mod 97), NOT to the IBAN-style ISO 7064 MOD 97-10 variant (98 - (n*100 mod 97)) that lives in the same file — this generator calls the plain mod97, not iso7064Mod9710CheckDigits.
  • The check is subtracted from 97, not 98; using 98 would be the wrong (ISO 7064) formula.
  • Leading zeros in the 8-digit payload matter for the string representation but are numerically ignored when computing the modulo.

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 enterprise numbers 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 10-digit enterprise number (default), or BE VAT number.
invalidbooleanReturn an enterprise number with a deliberately wrong check.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.

Response fields

FieldTypeDescription
valuestringThe number in the requested format (national or VAT).
digitsstringThe canonical, unprefixed 10-digit enterprise number.

Other generators for Belgium

See all generators for Belgium →

The same kind of identifier elsewhere

Try it

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