Generator · Dutch data

Dutch BSN

Endpoint GET /v1/nl/bsn

What it covers

Returns a valid Dutch BSN (Burgerservicenummer) with a correct elfproef check. The BSN is non-semantic — it encodes no birth date or sex. Set `invalid=true` for a BSN with a deliberately wrong check digit, or `edge=true` for valid edge-case numbers.

How it’s calculated

The Dutch BSN's ninth digit is an "elfproef" (11-test) check digit: the weighted sum of the eight payload digits modulo 11, where a residue of 10 marks a non-issued prefix.

Algorithm

  1. Start with the eight payload digits d1..d8 (the first digit is 1-9 for a normal BSN; 0 is allowed only in the leading-zero edge case).
  2. Assign fixed position weights to the eight payload digits, left to right: 9, 8, 7, 6, 5, 4, 3, 2.
  3. Compute the weighted sum: S = 9*d1 + 8*d2 + 7*d3 + 6*d4 + 5*d5 + 4*d6 + 3*d7 + 2*d8.
  4. Take the remainder R = S mod 11.
  5. If R equals 10, no single digit can satisfy the elfproef: the prefix is not a valid BSN and must be discarded (redraw). Otherwise the check digit c = R (a value 0-9).
  6. Append c as the ninth digit; the full BSN is d1 d2 d3 d4 d5 d6 d7 d8 c.
  7. The full elfproef equivalently reads Sum(w_i * digit_i) ≡ 0 (mod 11) over all nine digits with weights 9,8,7,6,5,4,3,2,-1; the -1 weight on the ninth digit makes c equal the mod-11 remainder of the first eight, exactly as computed above.
  8. Reject the all-zero number 000000000: it passes the arithmetic but is reserved and never issued.

Worked example

BSN with payload 12345678 and unknown check digit: 12345678?

Payload digits: d1..d8 = 1,2,3,4,5,6,7,8 with weights 9,8,7,6,5,4,3,2.
Products: 1*9=9, 2*8=16, 3*7=21, 4*6=24, 5*5=25, 6*4=24, 7*3=21, 8*2=16.
Weighted sum S = 9+16+21+24+25+24+21+16 = 156.
R = 156 mod 11: 11*14 = 154, so 156 - 154 = 2.
R = 2, which is not 10, so the check digit c = 2.

The check digit is 2, giving the full BSN 123456782.

Edge cases

  • Residue 10 has no valid single check digit, so such prefixes are treated as not-issued and redrawn.
  • Leading-zero BSNs are valid: numeric parsing that drops the leading 0 truncates the number below nine digits — the generator has a dedicated leading-zero edge class.
  • The all-zero number 000000000 satisfies the arithmetic but is reserved and explicitly rejected.

Gotchas

  • Because the ninth digit carries weight -1 in the classic elfproef formulation, it must be subtracted, not added, when verifying the full nine-digit sum ≡ 0 (mod 11); the generator sidesteps this by computing c directly as the mod-11 remainder of the eight payload digits.
  • Style is 'remainder' with the default 'invalid' overflow — the check digit is the raw remainder (0-9), never an 11-complement, and residue 10 yields undefined rather than mapping to another digit.

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 BSNs 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.
invalidbooleanReturn a BSN with a deliberately wrong elfproef check digit.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.

Response fields

FieldTypeDescription
valuestringThe BSN rendered as a 9-digit string.
digitsstringThe canonical 9-digit BSN.

Other generators for Netherlands

See all generators for Netherlands →

The same kind of identifier elsewhere

Try it

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