Generator · Polish data

Polish REGON

Endpoint GET /v1/pl/regon

What it covers

Returns a valid Polish REGON (business registry number) with correct check digit(s). Use `variant` to choose the 9-digit (`short`) or 14-digit (`long`) form, or `any` to pick one at random. Set `invalid=true` to get a REGON with a deliberately wrong check digit (both check digits for a long REGON), for testing checksum validators.

How it’s calculated

REGON's check digit is a weighted sum of the preceding digits taken modulo 11, with a remainder of 10 folded down to 0.

Algorithm

  1. Decide the variant. A short REGON is 9 digits: 8 base digits followed by 1 check digit. A long REGON is 14 digits: a full valid 9-digit REGON, then 4 more base digits, then 1 check digit. The 9-digit prefix of a 14-digit REGON is itself a valid 9-digit REGON.
  2. For the 9-digit check digit, take the 8 base digits d1..d8 and the weight vector W = [8, 9, 2, 3, 4, 5, 6, 7] (weight index i lines up with base digit i, both left to right).
  3. For the 14-digit check digit, take the 13 base digits d1..d13 and the weight vector W = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8].
  4. Compute the weighted sum S = sum over i of (W[i] * d[i]).
  5. Compute r = S mod 11.
  6. Compute the check digit c = r mod 10. In other words, if r is 10 the check digit is 0; otherwise the check digit is r itself. No prefix ever has to be redrawn — every base string yields a valid check digit.
  7. Append c as the final digit to produce the complete REGON.

Worked example

9-digit REGON with base digits 12345678 and check digit ?

Base digits: 1 2 3 4 5 6 7 8; weights: 8 9 2 3 4 5 6 7.
Products: 1*8=8, 2*9=18, 3*2=6, 4*3=12, 5*4=20, 6*5=30, 7*6=42, 8*7=56.
Weighted sum S = 8+18+6+12+20+30+42+56 = 192.
r = 192 mod 11 = 192 - 187 = 5 (since 11*17 = 187).
Check digit c = 5 mod 10 = 5.

The check digit is 5, so the full REGON is 123456785.

Edge cases

  • A weighted-sum remainder of exactly 10 is not a valid single digit; REGON folds it to 0 (r mod 10), so both remainder 0 and remainder 10 produce check digit 0.
  • The 14-digit long REGON embeds a complete, independently-valid 9-digit REGON as its first nine digits; the long check digit is computed over all 13 preceding digits, not just the extra four.

Gotchas

  • The two variants use different weight vectors AND different positions: the short vector [8,9,2,3,4,5,6,7] is not a prefix or suffix of the long vector [2,4,8,5,0,9,7,3,6,1,2,4,8]. One of the long weights is 0, so the fifth base digit of a 14-digit REGON never affects its check digit.
  • Unlike Polish NIP (which also uses mod-11 but rejects a remainder of 10 and requires redrawing), REGON never rejects: the remainder-10 → 0 fold guarantees every base string is valid.

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 REGONs 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 REGON with a deliberately wrong check digit.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.
variant"short" | "long" | "any"REGON length: short (9-digit), long (14-digit), or any.

Response fields

FieldTypeDescription
valuestringThe REGON: 9 digits (short) or 14 digits (long).
variant"short" | "long"Which REGON variant was produced.

Other generators for Poland

See all generators for Poland →

The same kind of identifier elsewhere

Try it

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