Sweden Personnummer Validator

Enter a Swedish personnummer to check its Luhn checksum and parse the birth date.

Result

Valid
6
81-12-18

How it is calculated

The tool removes every non-digit character, so dashes, plus signs and spaces are ignored. A 12-digit entry with the century has its first two digits set aside, and anything that is not 10 digits afterwards is reported as Invalid with no check digit. The first nine digits are multiplied by the weights 2, 1, 2, 1, 2, 1, 2, 1, 2 from the left; any product above 9 has 9 subtracted (the same as adding its two digits). The products are added to a sum S, and the expected check digit is (10 − S mod 10) mod 10. The result is Valid only if that equals the tenth digit you typed and the date part is a real date: month 1 to 12 and a day within that month, or day 61 to 91 for a samordningsnummer (the real day plus 60). 29 February is accepted only in a leap year; with a 12-digit entry the full year decides, with 10 digits any year divisible by 4 is accepted. The tool also shows the expected check digit and the first six digits as YY-MM-DD. It does not test whether the number was actually issued to anyone.

Worked example

Take 811218-9876. The nine digits are 8 1 1 2 1 8 9 8 7. Applying the weights 2,1,2,1,2,1,2,1,2 gives 16, 1, 2, 2, 2, 8, 18, 8, 14. Subtract 9 from every result above 9 to get 7, 1, 2, 2, 2, 8, 9, 8, 5. The sum is 44. The expected check digit is (10 − 4) mod 10 = 6. The number ends in 6 and 18 December 1981 is a real date, so it is reported as Valid, with the birth date part shown as 81-12-18. Changing the last digit to 7 would flag it as Invalid while still showing 6 as the expected check digit.

Try this example →

Common mistakes

  • Assuming Valid means the person exists. The checksum and the calendar date are tested, but not whether Skatteverket ever issued the number.
  • Typing a 12-digit number and expecting the century to be fully checked. The century is only used for the leap-year rule on 29 February (200002291235 is Valid, 190002291235 is Invalid); otherwise 1981 and 2081 give the same result.
  • Entering a number with a digit missing or extra. Anything that is not 10 digits (or 12 with century) is marked Invalid without a check digit.
  • Expecting the plus sign used for people over 100 to change the result. Separators are ignored, so + and - are treated the same.
  • Reading Invalid as a problem with the person's record when it is usually a typo. A single wrong digit anywhere in the first nine changes the expected check digit, and a day or month that does not exist fails even when the check digit matches.

About this calculator

The Swedish personnummer is the national identity number issued by Skatteverket (the Tax Agency) at birth or on immigration, formatted as YYMMDD-NNNC (or with a plus sign once the holder turns 100): a six-digit birth date, a three-digit serial number, and a final check digit.

That check digit is computed with the Luhn algorithm (mod 10): starting from the rightmost of the first nine digits, alternating digits are doubled, the digits of any two-digit results are summed, all ten values are added together, and the check digit is chosen so the total is a multiple of 10 — the same checksum used to validate credit card numbers.

Because the number embeds a real birth date, it is used far beyond taxation — in banking, BankID authentication, healthcare records, and everyday identification across Sweden — so validating both its format and its Luhn checksum is a common first step before accepting one in a form.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators