Generator · Estonian data

Estonian isikukood

Endpoint GET /v1/ee/isikukood

What it covers

Returns a valid Estonian isikukood (personal identification code) with a correct two-pass mod-11 check digit. Constrain with `sex` and age/birth-date filters (the full birth date is encoded). Contradictory combinations are rejected with a 400. Set `invalid=true` for a deliberately wrong check digit.

How it’s calculated

The Estonian isikukood check digit is a two-pass weighted-sum modulo-11 over the first ten digits (G YYMMDD SSS), falling back to a second weight set and finally 0 whenever a pass yields a residue of 10.

Algorithm

  1. Assemble the 10-digit payload as G YYMMDD SSS, where G is the century/sex leading digit, YYMMDD is the two-digit year, month and day of birth, and SSS is a three-digit serial number. The check digit is the 11th digit.
  2. Convert the 10 payload characters to their numeric digit values d[0..9] (leading zeros preserved).
  3. First pass: multiply each digit by weight1 at the same position, where weight1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 1]. Sum all ten products.
  4. Take that sum modulo 11. Call it r1.
  5. If r1 is less than 10, the check digit IS r1. Stop.
  6. Otherwise (r1 == 10), do a second pass: multiply each digit by weight2 at the same position, where weight2 = [3, 4, 5, 6, 7, 8, 9, 1, 2, 3]. Sum all ten products.
  7. Take that second sum modulo 11. Call it r2.
  8. If r2 is less than 10, the check digit IS r2. Otherwise (r2 == 10) the check digit is 0.
  9. Append the check digit to the payload to form the full 11-digit isikukood.

Worked example

Male born 1985-03-14, serial 007 → isikukood 385031400?

Payload (G YYMMDD SSS): G=3 (1900s band, male), YYMMDD=850314, serial=007 → 3850314007.
Digits: [3,8,5,0,3,1,4,0,0,7].
First pass with weights1 [1,2,3,4,5,6,7,8,9,1]: 3×1=3, 8×2=16, 5×3=15, 0×4=0, 3×5=15, 1×6=6, 4×7=28, 0×8=0, 0×9=0, 7×1=7.
Sum = 3+16+15+0+15+6+28+0+0+7 = 90.
90 mod 11 = 90 − 88 = 2. r1 = 2.
2 < 10, so the check digit is 2 — no second pass needed.
Full isikukood: 38503140072.

The check digit is 2, giving the full isikukood 38503140072.

Edge cases

  • The leading digit G is not free: it jointly encodes century and sex — 1/2 = 1800s male/female, 3/4 = 1900s male/female, 5/6 = 2000s male/female (odd = male, even = female). G values 7/8 are reserved for a future century and are never generated here.
  • When the first-pass residue is exactly 10 the check digit is NOT 10 (there is no two-digit check); the second weight set [3,4,5,6,7,8,9,1,2,3] is applied instead, and only if that also yields 10 does the check digit become 0.

Gotchas

  • The two weight sets are related by a rotation: weights2 is weights1 shifted so it starts at 3 (3,4,5,6,7,8,9,1,2,3). Using the wrong set on the fallback pass produces a subtly wrong-but-plausible check digit.
  • The check digit covers exactly the first ten digits including the leading G; it must be recomputed if any of G, the date, or the serial changes.
  • toDigits preserves leading zeros — the serial SSS and date fields are treated as a digit string, never parsed through Number, so a payload like 3850314007 keeps its interior zeros in the weighted sum.

Parameters

ParameterTypeDescription
atAgeintegerExact age in years at request time.
bornAfterstringpattern ^\d{4}(?:-\d{2}(?:-\d{2})?)?$Born after this date or fragment (YYYY, YYYY-MM, YYYY-MM-DD).
bornBeforestringpattern ^\d{4}(?:-\d{2}(?:-\d{2})?)?$Born before this date or fragment (YYYY, YYYY-MM, YYYY-MM-DD).
bornOnstringpattern ^\d{4}(?:-\d{2}(?:-\d{2})?)?$Born on a date or within a fragment: YYYY, YYYY-MM, or YYYY-MM-DD.
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 edge-case values.
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 an isikukood with a deliberately wrong mod-11 check digit; date/sex stay valid.
olderThanintegerMinimum age in years at request time.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.
sex"m" | "f"Encoded sex: "m" or "f".
youngerThanintegerMaximum age in years at request time.

Response fields

FieldTypeDescription
valuestringThe isikukood in the requested form.
digitsstringThe canonical 11-digit isikukood.
birthDatestringThe encoded birth date, ISO `YYYY-MM-DD`.
sex"m" | "f"Encoded sex: `m` (odd) or `f` (even) leading digit.

Other generators for Estonia

See all generators for Estonia →

The same kind of identifier elsewhere

Try it

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