Generator · Polish data

Polish land and mortgage register number

Endpoint GET /v1/pl/land-register

What it covers

Returns a valid Polish land and mortgage register number (numer księgi wieczystej) with a correct check digit. The four-character court department code is genuine, drawn from a curated table of real courts; only the eight-digit register number is synthetic. Use `court` to restrict the draw to a single court (by code, e.g. WA1M, or by a diacritic-sensitive name substring, e.g. Krakowie) — an unknown court is rejected with a 400. Use `format` to choose slashed (CCCC/NNNNNNNN/K) or compact rendering. Set `invalid=true` to get a number with a deliberately wrong check digit, for testing checksum validators.

How it’s calculated

The Polish land-and-mortgage-register number (numer księgi wieczystej) ends in a single check digit that is a positionally-weighted sum of its twelve significant characters, taken modulo 10.

Algorithm

  1. Take the full number CCCC/NNNNNNNN/K. The twelve SIGNIFICANT characters are the four court-department code characters (CCCC) followed by the eight register-number digits (NNNNNNNN). The slashes and the trailing check digit K itself are NOT part of the computation.
  2. Map each of the twelve characters to a numeric value: digits '0'–'9' map to their face value 0–9; the letter 'X' maps to 10; the remaining letters run consecutively A=11, B=12, C=13, D=14, E=15, F=16, G=17, H=18, I=19, J=20, K=21, L=22, M=23, N=24, O=25, P=26, R=27, S=28, T=29, U=30, W=31, Y=32, Z=33. Note the letters 'Q' and 'V' are SKIPPED (they never appear in court codes), so there is no gap in the running values.
  3. Assign a weight to each position by cycling the sequence 1, 3, 7 across the twelve characters left to right: position 0 -> 1, position 1 -> 3, position 2 -> 7, position 3 -> 1, position 4 -> 3, position 5 -> 7, and so on (weight = pattern[index mod 3]).
  4. Multiply each character's value by its position's weight, and add all twelve products together to get a single sum.
  5. The check digit is that sum modulo 10 (a single digit 0–9). Append it after the second slash to form CCCC/NNNNNNNN/K.

Worked example

KR1P/00123456/?

Significant characters (12): K R 1 P 0 0 1 2 3 4 5 6
Character values: K=21, R=27, 1=1, P=26, 0=0, 0=0, 1=1, 2=2, 3=3, 4=4, 5=5, 6=6
Weights cycling 1,3,7: pos0 K=21x1=21; pos1 R=27x3=81; pos2 1=1x7=7; pos3 P=26x1=26; pos4 0=0x3=0; pos5 0=0x7=0; pos6 1=1x1=1; pos7 2=2x3=6; pos8 3=3x7=21; pos9 4=4x1=4; pos10 5=5x3=15; pos11 6=6x7=42
Sum = 21+81+7+26+0+0+1+6+21+4+15+42 = 224
Check digit = 224 mod 10 = 4

The check digit is 4, giving the full number KR1P/00123456/4.

Edge cases

  • The court-code portion (CCCC) is alphanumeric, so the check-digit input mixes letters and digits — unlike a purely numeric identifier, the mod-10 sum can be driven by letter values up to 33.
  • The check digit is a plain modulo-10 residue, so all ten values 0–9 are reachable and none is reserved or unissued.
  • Because letters map with Q and V removed, the value sequence is contiguous (…P=26, R=27, S=28…) — implementers who naively use A=1..Z=26 or keep Q/V will get wrong values.

Gotchas

  • The two slashes and the check digit itself are excluded from the sum; only the 12 characters CCCC + NNNNNNNN are weighted. Feeding the slashes or the check digit into the sum gives a wrong result.
  • The weight pattern is 1,3,7 applied from the leftmost significant character (the court code), not from the register number — position 0 is the first court-code letter.

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.
courtstringRestrict to one court department, by four-character code (e.g. WA1M) or name fragment.
edgebooleanRestrict output to edge-case register numbers at the boundaries of the number space.
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"with-slashes" | "compact"Number rendering: with slashes or compact. Default with-slashes.
invalidbooleanReturn a number with a deliberately wrong check digit.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.

Response fields

FieldTypeDescription
valuestringThe register number in the requested format.
courtCodestringThe four-character court department code, e.g. "WA1M".
numberstringThe eight-digit zero-padded register number, e.g. "00012345".
checkDigitstringThe single check digit, e.g. "6".
court?stringName of the court department the code belongs to.

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.