Generator · Finnish data

Finnish Y-tunnus

Endpoint GET /v1/fi/y-tunnus

What it covers

Returns a valid Finnish Y-tunnus (business identity code) with a correct mod-11 check digit. Use `format` for the FI VAT number. Set `invalid=true` for a Y-tunnus with a deliberately wrong check digit.

How it’s calculated

The Finnish Y-tunnus (business identity code) ends in a single weighted mod-11 check digit computed as the 11-complement of the weighted sum of its seven leading digits, with residue 1 (complement 10) treated as an unissued prefix.

Algorithm

  1. Take the seven payload digits d1 d2 d3 d4 d5 d6 d7 (the Y-tunnus is 8 digits total; the 8th is the check digit).
  2. Multiply each payload digit by its fixed position weight from the list [7, 9, 10, 5, 8, 4, 2]: d1*7, d2*9, d3*10, d4*5, d5*8, d6*4, d7*2.
  3. Add the seven products together to get the weighted sum S.
  4. Compute the base residue: base = S mod 11.
  5. Compute the raw complement: raw = 11 - base.
  6. Resolve the raw value to the check digit: if raw == 11, the check digit is 0; if raw == 10 (i.e. base == 1), there is NO valid check digit — the prefix is not issued and must be redrawn; otherwise the check digit is raw itself (a value 2..9, or 0 came from the raw==11 case).
  7. Append the check digit as the 8th digit. Format 'national' renders it as ddddddd-c (seven digits, hyphen, check digit); format 'vat' renders it as FI followed by all eight bare digits with no hyphen.

Worked example

Y-tunnus with payload 1234567 and check digit ? (i.e. 1234567-?)

Payload digits: 1 2 3 4 5 6 7; weights: 7 9 10 5 8 4 2.
Products: 1*7=7, 2*9=18, 3*10=30, 4*5=20, 5*8=40, 6*4=24, 7*2=14.
Weighted sum S = 7+18+30+20+40+24+14 = 153.
base = 153 mod 11 = 10 (since 11*13 = 143, 153-143 = 10).
raw = 11 - 10 = 1.
raw is neither 11 nor 10, so the check digit is raw = 1.

The check digit is 1, giving the full Y-tunnus 1234567-1 (VAT form FI12345671).

Edge cases

  • Residue base == 1 (raw complement == 10) has no single-digit representation: such a seven-digit prefix is never issued. The generator's computeYTunnusCheckDigit returns undefined and the draw loop redraws a fresh prefix.
  • Residue base == 0 gives raw == 11, which maps to check digit 0 (not 11).

Gotchas

  • The first payload digit is drawn 1-9 (not 0) for the common Y-tunnus shape; the remaining six are 0-9. This is a generation choice, not a checksum rule — the checksum itself does not forbid a leading zero.
  • The VAT form is literally 'FI' + the eight bare digits with NO hyphen; the hyphen appears only in the 'national' ddddddd-c grouping. The check digit is the same in both forms.
  • The weight list applies to the seven payload digits in order; the 8th (check) digit has no weight of its own — it is the output, not an input to the sum.

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 Y-tunnukset 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: national `#######-#` form (default) or FI VAT number.
invalidbooleanReturn a Y-tunnus 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 identifier in the requested format (national or VAT).
digitsstringThe canonical, unhyphenated 8-digit Y-tunnus.

Other generators for Finland

See all generators for Finland →

The same kind of identifier elsewhere

Try it

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