Generator · Irish data

Irish PPSN

Endpoint GET /v1/ie/ppsn

What it covers

Returns a valid Irish PPSN (Personal Public Service Number) with a correct mod-23 check letter. Use `standard` for the `modern` (post-2013) or `pre-2013` form. Set `invalid=true` for a PPSN with a deliberately wrong check letter.

How it’s calculated

The Irish PPSN check character is a letter from a 23-symbol alphabet chosen by a weighted sum of the seven body digits (weights 8,7,6,5,4,3,2) taken modulo 23, with the modern (post-2013) form adding 9× the trailing second-letter's alphabet index before the modulo.

Algorithm

  1. Take the seven-digit body D1 D2 D3 D4 D5 D6 D7 (first digit 1-9, the rest 0-9). Read them left to right as digit values.
  2. Apply the position weights [8, 7, 6, 5, 4, 3, 2] to the seven digits in order: base = 8*D1 + 7*D2 + 6*D3 + 5*D4 + 4*D5 + 3*D6 + 2*D7.
  3. Decide the form. Pre-2013 form: no trailing second letter — the second contribution is 0. Modern (post-2013) form: there is a trailing second letter (the generator uses 'A' for individuals).
  4. For the modern form, find the second letter's index in the alphabet 'WABCDEFGHIJKLMNOPQRSTUV' (W=0, A=1, B=2, ... V=22) and compute secondContribution = 9 * that index. For 'A' this index is 1, so secondContribution = 9. For the pre-2013 form secondContribution = 0.
  5. Sum them: total = base + secondContribution.
  6. Compute remainder = total mod 23 (a value 0-22). No complement and no overflow handling — the remainder is used directly.
  7. Look up the check letter as the character at position `remainder` in the alphabet 'WABCDEFGHIJKLMNOPQRSTUV' (index 0 = 'W', index 1 = 'A', ..., index 22 = 'V').
  8. Assemble the identifier. Pre-2013 form: seven digits followed by the check letter (e.g. 1234567X). Modern form: seven digits, then the check letter, then the trailing second letter (e.g. 1234567XA).

Worked example

PPSN body 1234567, modern form with second letter A → 1234567?A

Digits: 1,2,3,4,5,6,7. Weights: 8,7,6,5,4,3,2.
Weighted products: 8*1=8, 7*2=14, 6*3=18, 5*4=20, 4*5=20, 3*6=18, 2*7=14.
base = 8+14+18+20+20+18+14 = 112.
Second letter 'A' has index 1 in 'WABCDEFGHIJKLMNOPQRSTUV', so secondContribution = 9*1 = 9.
total = 112 + 9 = 121.
121 mod 23 = 121 - (5*23=115) = 6.
Alphabet 'WABCDEFGHIJKLMNOPQRSTUV' at index 6: W(0)A(1)B(2)C(3)D(4)E(5)F(6) → 'F'.
Check letter = F.

The check letter is F, giving the full modern PPSN 1234567FA.

Edge cases

  • Remainder 0 maps to the letter 'W', not a digit — the alphabet is deliberately ordered so W sits at index 0 (this is the classic Irish 'W' check-character case).
  • The modern (post-2013) form has a trailing second letter after the check letter; the generator uses 'A' for individuals, and that letter feeds back into the checksum via the 9× term. Changing the second letter changes the check letter.
  • Pre-2013 form uses secondContribution = 0, so the same body digits can yield a different check letter than the modern form.

Gotchas

  • The check letter is NOT a mod-11/mod-10 digit and there is no complement or overflow rule — the remainder (0-22) indexes directly into the 23-character alphabet.
  • The alphabet is 'WABCDEFGHIJKLMNOPQRSTUV' (23 letters, W at index 0 then A-V) — it is NOT plain A-W, so charToValue/valueToChar must use this exact string.
  • In the modern form the second letter contributes 9× its index in that SAME alphabet (A=1 → +9), so the checksum depends on the second letter, not just the seven digits.

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 PPSNs 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 PPSN with a deliberately wrong check letter.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.
standard"pre-2013" | "modern" | "both"PPSN form: `modern` (post-2013, default), `pre-2013`, or `both` (random per record).

Response fields

FieldTypeDescription
valuestringThe full PPSN, e.g. `1234567FA`.
digitsstringThe canonical seven-digit body.
checkLetterstringThe single check letter.
secondLetter?stringThe trailing second letter, present only in the modern form.

Other generators for Ireland

See all generators for Ireland →

The same kind of identifier elsewhere

Try it

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