Generator · Estonian data

Estonian KMKR

Endpoint GET /v1/ee/kmkr

What it covers

Returns a valid Estonian KMKR (käibemaksukohustuslase number, VAT number) with a correct check digit. Use `format=vat` for the `EE`-prefixed intra-EU VAT identifier. Set `invalid=true` for a KMKR with a deliberately wrong check digit.

How it’s calculated

The 9th digit of an Estonian KMKR (VAT registration number) is a weighted mod-10 check digit computed over the first eight digits with the repeating weight pattern 3, 7, 1.

Algorithm

  1. Start from the eight payload digits d1..d8 (the KMKR without its final check digit). The first digit d1 is 1-9 for the common shape; d2..d8 are 0-9.
  2. Apply the fixed weight vector [3, 7, 1, 3, 7, 1, 3, 7] positionally: multiply d1 by 3, d2 by 7, d3 by 1, d4 by 3, d5 by 7, d6 by 1, d7 by 3, d8 by 7.
  3. Sum all eight weighted products into S (a plain integer sum, no intermediate reduction).
  4. Take r = S mod 10.
  5. Compute the check digit as c = (10 - r) mod 10. The outer 'mod 10' makes c = 0 when r = 0, so the result is always a single digit 0-9 and never needs a redraw.
  6. Append c as the 9th digit: the full KMKR is d1 d2 d3 d4 d5 d6 d7 d8 c.
  7. (Equivalent validation view: over all nine digits with weights [3,7,1,3,7,1,3,7,1], the weighted sum is congruent to 0 mod 10 — the check digit carries its own weight 1.)
  8. For the 'vat' output format, prefix the literal 'EE' to the nine digits (EE + KMKR); the 'national' format returns the bare nine digits. The EE prefix is not part of the checksum input.

Worked example

KMKR payload 19283746 with check digit ? → 19283746?

Payload digits: 1,9,2,8,3,7,4,6; weights: 3,7,1,3,7,1,3,7.
Weighted products: 1×3=3, 9×7=63, 2×1=2, 8×3=24, 3×7=21, 7×1=7, 4×3=12, 6×7=42.
Sum S = 3+63+2+24+21+7+12+42 = 174.
r = 174 mod 10 = 4.
Check digit c = (10 - 4) mod 10 = 6.
Cross-check (full-number rule, weights 3,7,1,3,7,1,3,7,1): 174 + 6×1 = 180; 180 mod 10 = 0. Valid.

The check digit is 6, so the full KMKR is 192837466 (VAT form EE192837466).

Edge cases

  • When the weighted sum of the eight payload digits is already ≡ 0 mod 10, the check digit is 0 (the outer mod-10 collapses the would-be '10' to '0'); it never spills into two digits, so no prefix is ever redrawn.
  • The common generator draws d1 in 1-9 (no leading zero); a leading-zero first digit is deliberately reserved for the separate edge-case generator.

Gotchas

  • The check digit uses the repeating weight pattern 3,7,1 (NOT the ICAO/Luhn family). Only eight weights [3,7,1,3,7,1,3,7] are applied to the payload; the 9th position's implicit weight is 1 and appears only in the full-number validation view Σ wᵢ·dᵢ ≡ 0 (mod 10).
  • The 'EE' VAT prefix is a formatting decoration, not checksum input — compute the check digit on the nine numeric digits only.
  • Corruption for edge/invalid samples adds an offset 1..9 mod 10 to the correct check digit; because the offset is never 0 mod 10, the mutated digit is guaranteed to fail the weighted-mod-10 check.

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 KMKRs 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 9-digit KMKR (default) or `EE`-prefixed VAT number.
invalidbooleanReturn a KMKR with a deliberately wrong check digit.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.

Response fields

FieldTypeDescription
valuestringThe identifier in the requested format (national or VAT).
digitsstringThe canonical, unprefixed 9-digit KMKR.

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.