Swedish Personnummer Validator
Validate a Swedish personnummer (personal number) with the Luhn algorithm and extract the birth date and gender. Useful for Swedish records and data validation.
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
IMEI Validator
Validate a phone IMEI (15 digits) using the Luhn algorithm. Check whether a device identification number is valid before buying or registering it.
Credit Card Validator
Validate credit card numbers using the Luhn algorithm. Identifies the card brand and verifies the check digit, no data sent to servers.
IMEI Validator (Luhn)
Validate a phone IMEI (15 digits) using the Luhn algorithm. Check whether a device identification number is valid before buying or registering it.
Luhn Validator (generic)
Validate any numeric sequence using Luhn (mod 10) — used in credit cards, IMEI, ICCID and other IDs. Shows check digit.
ICCID SIM Validator
Validate the ICCID (Integrated Circuit Card Identifier) of SIM chips (19-20 digits) with Luhn digit check and carrier identification.
Country Bank Account Validator
Validate basic bank account format by country: BR (X-D), PT (21-digit NIB), US (9-digit routing), CA, UK.