Info & Definition Swedish Personal Identity Numbers
The personal identity number (personnummer) is the Swedish national identification number. It is a ten or twelve digit number that is used in Sweden to identify individuals.
Pattern
The official version of a Swedish Personal Identity Number (defined in law) follow this pattern:
- YYMMDD-BBBC
- YYMMDD+BBBC
The delimiter is - (hyphen) by default but changes to + (plus) the year you turn 100. See details below.
It's quite common to leave the hyphen out, like this:
- YYMMDDBBBC
When stored or handled in a structured way, the law states you should handle it with the full length of the year, like this:
- YYYYMMDDBBBC
Parts
The parts are:
Birthdate
The first 6 digits correspond to the person's birthday.
Note: In case the specific day is out of numbers, another day (close to the correct one) is used.
- YY: Year
- MM: Month
- DD: Day
Delimiter
They are followed by a hyphen or a plus.
By default it is a hyphen, but the year a person turns 100 the hyphen with a plus sign.
Note: A common misunderstanding is that the hyphen is replaced with a plus sign when the person turns 100 years old, but according to the definition, it happens the first of January that year.
- -: Hyphen delimiter
- +: Plus delimiter
Birth number
Among the four last digits, the three first are a birth number (serial number).
Note: For the last digit among these three, an odd number is assigned to males and an even number to females.
- BBB: Birth number
Checksum
The last digit is a checksum calculated using the Luhn algorithm.
To calculate the checksum: Use the 10 digit version, multiply the individual digits in the identity number and 212121-212. The resulting products (a two digit product, such as 16, would be converted to 1 + 6) are added together. The checksum is the last digit of 10 minus the last digit in this sum (note that if the last digit of the sum is zero, the checksum is 0).
- C: Checksum
Sources
The definition of a Swedish personal identity number is described in Swedish law (Folkbokföringslagen), there are also other sources for clarifications listed below.