Swedish Personal Identity Number
Validate and Generate a Swedish National Identification Number Easily and Quickly
This is a Swedish Personal Identity Number validation tool, you can enter the appropriate value to get the verification results, for the convenience of use, the tool provides a generator, you can use the generator to test the results.
What is Swedish Personal Identity Number?
The Swedish personal identity number composed of 10 digits and a hyphen. The first 6 digits correspond to the person's birthdate, in YYMMDD format. They are followed by a hyphen, and four final digits. People over the age of 100 replace the hyphen with a plus sign. Among the four last digits, the first three are a serial number. The last digit of these three represents gender. An odd number is assigned to males and an even number to females. The last digit of SSN is the checksum which is calculated using Luhn algorithm.
SSN Generation and Validation
The SSN Generator is designed to developers in need of randomly generated data for testing cases. The SSN validation validates the numbers pattern for a given state area code. Therefore, if a SSN passes this tool validation, it doesn't mean that it really exists, only that it's code, for the given pattern, is possible. This is the same validation that guarantees the basic authentication, of generated ssn's, for forms under development, as they merely checks for a possible pattern. Generated SSN's aren't real, and shouldn't be used on attempt of any illegal activity.
How the personnummer is put together
A Swedish personal identity number is ten digits written as YYMMDD-NNNN. Every part of it means something — unlike some national identifiers, this one is a speaking number.
- The first six digits — date of birth, as year, month and day.
- The separator — a hyphen normally, replaced by a plus sign once the holder passes 100. This is the only marker of century in the short form.
- The next three digits — a birth number distinguishing people born on the same day.
- The third of those — the ninth digit overall — encodes sex: odd for men, even for women.
- The final digit — a Luhn check digit covering the preceding nine.
Ten digits or twelve?
You will meet both forms. The ten-digit version is what people write by hand and what appears on most documents. The twelve-digit version prefixes the full four-digit year — 19850615-3876 rather than 850615-3876.
The longer form exists because the short one is ambiguous: 850615 could be 1885 or 1985, and the plus-sign convention only tells you the person is over 100 at the time of writing. Systems that need to store dates unambiguously should keep twelve digits and render ten for display.
Why the encoded birth date matters
Because the date of birth and sex are readable directly from the number, a personnummer discloses more about its holder than a purely random identifier would. Quoting one in full reveals someone's exact age and sex whether or not that was intended — worth bearing in mind when deciding which systems really need to store it.
What this tool checks
Validation here is structural: the date has to be real, the format has to parse, and the Luhn digit has to agree with the other nine. Passing means well-formed, never issued to somebody. There is no lookup against any register, and there should not be.