1001Ferramentas
🇸🇪Validators

Swedish Personnummer Validator

Validates Swedish personnummer (YYMMDD-XXXX with Luhn) including date and gender check.

Aceita os formatos YYMMDD-XXXX (10 dígitos com hífen), YYMMDD+XXXX (100+ anos) ou YYYYMMDDXXXX (12 dígitos). O último dígito é Luhn sobre os 9 anteriores.

Personnummer: Sweden's personal identity number with a Luhn check

The Swedish personnummer identifies every resident and is built from a date of birth + a 4-digit suffix, written YYMMDD-NNNC (or YYYYMMDDNNNC). The final digit C is a Luhn check digit over the preceding nine, so a mistyped number is caught instantly. This tool validates that checksum; the example 811228-9874 passes.

The separator carries meaning: a hyphen - is normal, but it becomes a plus + once the person turns 100, signalling the older century. The third suffix digit also encodes sex (odd = male, even = female).

Anatomy of 811228-9874

  • YYMMDD (811228): the birth date.
  • Separator: - under 100 years old, + at 100+.
  • NNN (987): birth-number; its last digit's parity gives the sex.
  • C (4): the Luhn check digit over the nine digits.

Where it matters

  • Everything in Sweden: healthcare, banking (BankID), tax (Skatteverket), employment.
  • Coordination number: non-residents get a samordningsnummer with +60 on the day — structurally similar.
  • Sex from the number: the penultimate digit's parity historically indicates sex.
  • Mock data / testing: Luhn lets you generate valid-format test numbers.

Common pitfalls

  • The + separator: don't treat + as invalid — it marks a person aged 100 or more.
  • 10 vs 12 digits: the century may be implicit; normalise before applying Luhn over the right nine digits.
  • Checksum ≠ registered: a Luhn-valid number isn't necessarily an assigned personnummer.
  • Sensitive PII: the personnummer is heavily protected — use synthetic data for testing.

FAQ

What does the + mean? It replaces the hyphen once the person is 100+ years old, disambiguating the century.

Which digit is the checksum? The last one, computed with the Luhn algorithm over the preceding nine.

Can I read sex from it? Traditionally yes — the second-to-last digit is odd for men, even for women.

Related Tools