Generator · Polish data
Polish NIP
Endpoint GET /v1/pl/nip
What it covers
Returns a valid Polish NIP (tax identifier) with a correct checksum. Use `format` to choose between hyphenated and digits-only rendering. Set `invalid=true` to get a NIP with a deliberately wrong check digit, for testing checksum validators.
A NIP (Numer Identyfikacji Podatkowej) is the ten-digit tax identifier the Polish Ministry of Finance issues to businesses. The first nine digits identify the taxpayer; the tenth is a mod-11 check digit.
How it’s calculated
The tenth digit is a weighted mod-11 check digit — equal to the weighted sum mod 11, with residue 10 unissued.
Algorithm
- Take the first nine digits d₁…d₉.
- Multiply them by the weights 6, 5, 7, 2, 3, 4, 5, 6, 7 respectively.
- Sum the nine products.
- Take that sum modulo 11.
- If the result is 10, the prefix is invalid (no NIP is issued for it). Otherwise the result IS the check digit.
Worked example
123456789?
1×6 = 6
2×5 = 10
3×7 = 21
4×2 = 8
5×3 = 15
6×4 = 24
7×5 = 35
8×6 = 48
9×7 = 63
sum = 6+10+21+8+15+24+35+48+63 = 230
230 mod 11 = 10
residue is 10 → this prefix has no valid check digit and is rejectedBecause 123456789 yields residue 10, it is not a valid NIP prefix — the generator would redraw. This is exactly the “residue 10 unissued” rule in action.
References
Edge cases
- The first digit is drawn 1–9 — a NIP is never zero-padded, because tax-office prefixes don’t start with zero.
- Not every nine-digit prefix has a valid check digit: when the weighted sum is congruent to 10 mod 11, there is no issuable check digit and the prefix is discarded and redrawn. So the generated space is slightly smaller than all 9-digit prefixes.
Gotchas
- The NIP check digit is the weighted sum taken mod 11 directly — it is NOT “11 minus the remainder”. A validator that subtracts will reject every real NIP.
- Formatting (the dashes in 123-456-78-90) is cosmetic; the checksum runs on the ten bare digits.
Parameters
| Parameter | Type | Description |
|---|---|---|
| count | integer1–1000 | Number of records to return, 1–1000 (your plan may lower this). Omitted returns a single record; set it for a batch. |
| edge | boolean | Restrict output to valid edge-case NIPs from the rare corners. |
| extreme | boolean | Return 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 | "with-hyphens" | "digits-only" | NIP rendering: with hyphens or digits only. Default with-hyphens. |
| invalid | boolean | Return a NIP with a deliberately wrong check digit. |
| seed | integer | Integer seed for reproducible output: the same seed always yields the same record. |
Response fields
| Field | Type | Description |
|---|---|---|
| value | string | The NIP in the requested format. |
| digits | string | The canonical, unformatted 10-digit NIP. |
Other generators for Poland
The same kind of identifier elsewhere
Try it