Generator · Estonian data

Estonian registrikood

Endpoint GET /v1/ee/registrikood

What it covers

Returns a valid Estonian registrikood (Commercial Register code for a legal entity) with a correct two-pass mod-11 check digit. Set `invalid=true` for a registrikood with a deliberately wrong check digit.

How it’s calculated

The Estonian registrikood (business registry code) is an 8-digit number whose final digit is a two-pass ISO 7064-style modulo-11 check digit computed over the first seven digits.

Algorithm

  1. Take the seven payload digits d1 d2 d3 d4 d5 d6 d7 (the first seven of the eight-digit registrikood). d1 is the entity-type marker and is one of 1, 7, 8, 9, but for the checksum it is treated as an ordinary digit.
  2. First pass: multiply each payload digit by its position weight from weights1 = [1, 2, 3, 4, 5, 6, 7], i.e. sum1 = 1*d1 + 2*d2 + 3*d3 + 4*d4 + 5*d5 + 6*d6 + 7*d7.
  3. Compute r1 = sum1 mod 11.
  4. If r1 is less than 10, the check digit is r1. Stop.
  5. Otherwise (r1 == 10) run the second pass: multiply each payload digit by its position weight from weights2 = [3, 4, 5, 6, 7, 8, 9], i.e. sum2 = 3*d1 + 4*d2 + 5*d3 + 6*d4 + 7*d5 + 8*d6 + 9*d7.
  6. Compute r2 = sum2 mod 11.
  7. If r2 is less than 10, the check digit is r2. Otherwise (r2 == 10) the check digit is 0.
  8. Append the resulting single check digit as the eighth digit.

Worked example

registrikood 1234567?

Payload digits: d1=1, d2=2, d3=3, d4=4, d5=5, d6=6, d7=7.
First pass with weights1 = [1,2,3,4,5,6,7]: 1*1 + 2*2 + 3*3 + 4*4 + 5*5 + 6*6 + 7*7 = 1 + 4 + 9 + 16 + 25 + 36 + 49 = 140.
r1 = 140 mod 11 = 140 - 132 = 8.
8 is less than 10, so the check digit is 8. The second pass is not needed.
Full registrikood: 12345678.

The check digit is 8, giving the full registrikood 12345678.

Edge cases

  • When the first-pass residue r1 equals 10, the check digit is not simply 10 (which is not a single digit); a second weighted pass with weights [3,4,5,6,7,8,9] is run instead, and if that residue is also 10 the check digit falls back to 0. This mirrors the ISO 7064 two-pass fallback used by Estonia and Lithuania.
  • The leading digit d1 encodes the entity type: 1 = commercial company, 7 = state institution, 8 = non-profit association, 9 = foundation. The generator only draws d1 from {1,7,8,9}, but the check-digit math treats d1 as a plain digit with weight 1.

Gotchas

  • The weights are the plain ascending sequences 1..7 (first pass) and 3..9 (second pass), NOT a repeating/cyclic Lithuanian-personal-code style pattern. This generator passes exactly weights1=[1,2,3,4,5,6,7] and weights2=[3,4,5,6,7,8,9].
  • The check digit is the raw residue itself (a 'remainder' scheme), never an 11-complement. There is no 11-minus-sum step; only the two-pass overflow-at-10 fallback applies.

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 registrikoods 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 registrikood with a deliberately wrong mod-11 check digit.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.

Response fields

FieldTypeDescription
valuestringThe registrikood in the requested form.
digitsstringThe canonical 8-digit registrikood.

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.