Generator · Canadian data

Canadian SIN

Endpoint GET /v1/ca/sin

What it covers

Returns a synthetic Canadian Social Insurance Number. Unlike the US SSN it carries a **real Luhn checksum**, so it is genuinely verifiable and `invalid=true` breaks the arithmetic rather than merely violating a range. The first digit records the province or region of registration — the only geography a SIN carries, and it records where the number was *applied for*, not where the holder lives now. A leading `9` marks a temporary resident, whose number expires in reality; `0` and `8` are never issued.

A Social Insurance Number is nine digits protected by the Luhn (mod-10) algorithm — the same checksum used on payment cards. This makes it genuinely verifiable, in sharp contrast to the US SSN, which carries no checksum and can only be checked against issuable ranges.

The first digit records the province or region of registration: 1 for Atlantic Canada and overseas registrations, 2–3 Quebec, 4–5 Ontario, 6 the Prairies plus NT and NU, 7 the Pacific region (BC and YT), and 9 for temporary residents. 0 and 8 are never issued.

How it’s calculated

The ninth digit is a Luhn (mod-10) check digit computed over the preceding eight.

Algorithm

  1. Read the nine digits from the right.
  2. Double every second digit (that is, positions 2, 4, 6 and 8 counting from the left).
  3. If a doubled value exceeds 9, subtract 9 from it.
  4. Sum all nine resulting values.
  5. The number is valid when that sum is ≡ 0 (mod 10).

Worked example

046454286 (the test number Service Canada publishes)

d₁=0 kept → 0
d₂=4 doubled → 8
d₃=6 kept → 6
d₄=4 doubled → 8
d₅=5 kept → 5
d₆=4 doubled → 8
d₇=2 kept → 2
d₈=8 doubled → 16, and 16 − 9 = 7
d₉=6 kept → 6
sum = 0+8+6+8+5+8+2+7+6 = 50
50 mod 10 = 0 → valid

The Luhn sum is 50, which clears mod 10, so 046 454 286 satisfies the checksum. Note its leading 0 — which is exactly why Service Canada can publish it as a test number: 0 is never assigned as a first digit, so this value checksums correctly yet could never have been issued to a real person. Checksum validity and issuability are two separate tests, and this generator honours both.

Edge cases

  • A SIN beginning 9 belongs to a temporary resident — someone authorised to work in Canada who is neither a citizen nor a permanent resident. Real 9-series SINs carry an expiry date, which is exactly why systems assuming every SIN is permanent break on them.
  • The region digit records where the number was APPLIED FOR, not where the holder was born or now lives — someone who registered in Ontario and moved to Alberta still holds a 4.

Gotchas

  • A valid Luhn checksum is not sufficient: 0 and 8 are never issued as first digits, so a number can satisfy the arithmetic and still be unissuable. That is precisely one of the corruption classes `invalid=true` draws.
  • Formatting (the spaces in 046 454 286, or hyphens) is cosmetic; the checksum runs on the nine bare digits.

Parameters

ParameterTypeDescription
countinteger1–10000Number of records to return, 1–10000. Omitted returns a single record; set it for a batch. Costs 1 token plus a tenth per record.
edgebooleanRestrict output to valid edge cases from the rare corners of the domain.
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.
firstDigitintegerRegion of registration: 1 (Atlantic), 2-3 (Quebec), 4-5 (Ontario), 6 (Prairies/NT/NU), 7 (BC/YT), 9 (temporary resident). 0 and 8 are never issued and are rejected.
format"plain" | "with-spaces" | "with-hyphens"Rendering: `with-spaces` (default, `046 454 286`), `with-hyphens`, or `plain`.
invalidbooleanReturn a deliberately invalid value that fails validation, for testing rejection paths.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.
temporaryResidentbooleanEmit a temporary-resident SIN (first digit 9). These expire in reality.

Response fields

FieldTypeDescription
valuestringThe SIN rendered per `format` (space-separated by default).
digitsstringThe canonical nine digits, unformatted.
checkDigitstringThe ninth digit, which satisfies the Luhn checksum.
registrationRegionstringThe province or region the first digit records — where the SIN was applied for.
temporaryResidentbooleanWhether this is a temporary-resident SIN (first digit 9); such numbers expire.

Other generators for Canada

See all generators for Canada →

The same kind of identifier elsewhere

Try it

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