How a personnummer is built
Every person registered in Sweden has a personnummer, the ten-digit number that banks, doctors, employers and schools ask for. It isn't secret: it is printed on ID cards and is a public record in Sweden. Skatteverket, the Swedish Tax Agency, describes its parts like this:
| Part | Example | What it means |
|---|---|---|
| Date of birth | 900101 | Year, month and day: 1 January 1990. Systems often store the full year: 19900101. |
| Separator | - | A hyphen, changed to a plus sign (+) the year the person turns 100. |
| Birth number | 238 | Three digits that tell apart people born on the same day. |
| Sex digit | 8 | The last digit of the birth number: odd for men, even for women (current rule). |
| Check digit | 5 | Calculated from the other nine digits, so typos are caught. |
Before 1990 the first two digits of the birth number showed which county you were born in; since then they are assigned without any link to a place. When a single date runs out of birth numbers, a nearby date can be used instead, so the date in a personnummer is very occasionally not the real birthday.
How the check digit works
The last digit is a Luhn check digit (also called modulus 10), the same scheme bank cards use. Take the first nine digits, multiply them by 2, 1, 2, 1, 2, 1, 2, 1, 2, and add the digits of each product. For Skatteverket's test number 900101-2385:
| Position | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|
| Digit | 9 | 0 | 0 | 1 | 0 | 1 | 2 | 3 | 8 |
| × weight | 2 | 1 | 2 | 1 | 2 | 1 | 2 | 1 | 2 |
| = product | 18 | 0 | 0 | 1 | 0 | 1 | 4 | 3 | 16 |
| digit sum | 9 | 0 | 0 | 1 | 0 | 1 | 4 | 3 | 7 |
The sum is 25. The check digit is what brings it to the next multiple of ten: 30 − 25 = 5. If the sum already ends in 0, the check digit is 0. The check catches any single wrong digit and most swapped pairs, but it can't tell whether a number has actually been issued.
Samordningsnummer: day of birth + 60
A samordningsnummer (coordination number) is for people who aren't registered in the Population Register but still need an identity number in Sweden, for example to work or study here for less than a year. It is built like a personnummer, except that 60 is added to the day of birth. Skatteverket's own example: someone born on 3 October 1970 gets a number starting 701063.
| Personnummer | Samordningsnummer | |
|---|---|---|
| Who gets it | Everyone in the Population Register | People who are not, or have never been, registered |
| Typical reason | Moving to Sweden for a year or more | Working, studying or owning property here for a shorter time |
| Day digits | 01–31 | 61–91 (day + 60) |
| How long it lasts | For life | Inactivated after five years without use; can be reactivated |
| If you later move here | — | You get a personnummer instead |
Since 2023 you can apply for a samordningsnummer yourself, but you have to prove your identity in person at a service centre and show why you need one. Skatteverket says it can take up to six weeks before an administrator picks up the application.
Getting a personnummer when you move to Sweden
There is no separate application for a personnummer: you receive one when Skatteverket enters you in the Population Register (folkbokföring). In outline, according to Skatteverket:
- You should be registered if you move to Sweden and plan to live here for one year or more.
- Report your move with Skatteverket's Moving to Sweden e-service (in English, Arabic, Ukrainian and Swedish), uploading copies of your passport pages.
- Book a visit to a state service centre (servicekontor) for an identity check. Bring your original passport or ID card and any residence permit card from the Migration Agency.
- Wait. Skatteverket says it takes about five weeks before an administrator picks up a case. If you are registered, the personnummer comes with the decision.
EU and non-EU citizens have different requirements (right of residence versus a residence permit), so read the page for your situation: Moving to Sweden and Coordination numbers on skatteverket.se. Last checked 7 October 2026. Rules change; Skatteverket is the authority, not us. Our guide to the language side of moving to Sweden covers SFI and what to learn first.
Organisationsnummer
Companies, associations and authorities have an organisationsnummer: also ten digits with a Luhn check digit, written NNNNNN-NNNN. To keep it from being mistaken for a personnummer, the third digit is always 2 or higher, as if the "month" were 20 or more. A sole trader (enskild firma) has no separate number and uses the owner's personnummer. In 12-digit form, organisation numbers are often written with 16 in front.
The first digit is a group number that hints at the kind of organisation. Skatteverket points out that you can't read the legal form from the number alone, but in practice:
| First digit | Usually |
|---|---|
| 1 | Estates of deceased persons (dödsbon) |
| 2 | The state, regions, municipalities, parishes |
| 3 | Foreign companies |
| 5 | Limited companies (aktiebolag) |
| 6 | Jointly owned property (samfälligheter) |
| 7 | Economic associations, housing co-operatives, joint property associations |
| 8 | Non-profit associations, foundations |
| 9 | Trading and limited partnerships |
For developers: validate a personnummer in TypeScript
If you are building a form for Swedish users, here is a small, dependency-free validation function. It accepts the 10- and 12-digit forms, handles the + separator and samordningsnummer, checks the date and the Luhn digit. Paste it into any TypeScript project (delete the type annotations for plain JavaScript); copy it freely.
/**
* Validates a Swedish personnummer or samordningsnummer.
* Accepts YYMMDD-NNNN, YYMMDD+NNNN (100 or older), YYYYMMDDNNNN, with or without "-".
* Checks the format, that the date exists (day - 60 for samordningsnummer)
* and the Luhn check digit. It cannot tell whether the number has been issued.
*/
export function isValidPersonnummer(input: string, today = new Date()): boolean {
const m = input.replace(/\s/g, "").match(/^(\d{2})?(\d{2})(\d{2})(\d{2})([-+]?)(\d{3})(\d)$/);
if (!m) return false;
const [, cc, yy, mm, dd, sep, nnn, c] = m;
// Century: given in the 12-digit form; otherwise the latest year that isn't
// in the future, minus 100 years when the separator is "+".
let year: number;
if (cc) {
if (sep === "+") return false;
year = Number(cc + yy);
} else {
const now = today.getFullYear();
year = Math.floor(now / 100) * 100 + Number(yy);
if (year > now) year -= 100;
if (sep === "+") year -= 100;
}
const month = Number(mm);
let day = Number(dd);
if (day > 60) day -= 60; // samordningsnummer
const date = new Date(year, month - 1, day);
if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) return false;
if (date > today) return false;
// Luhn over the ten digits YYMMDDNNNC: double every other digit from the left.
const digits = yy + mm + dd + nnn + c;
let sum = 0;
for (let i = 0; i < 10; i++) {
let d = Number(digits[i]);
if (i % 2 === 0) {
d *= 2;
if (d > 9) d -= 9;
}
sum += d;
}
return sum % 10 === 0;
}A few things worth knowing before you ship it:
- Store the 12-digit form. The 10-digit form loses the century, and the + only tells you someone is over 100 on the day it is written.
- Validation is not identification. A valid number can belong to someone else. Use BankID or another e-ID to know who a user is.
- It's personal data. Under GDPR and Sweden's data protection law, only process personnummer when clearly justified, and keep them out of logs, URLs and analytics.
- Test with test numbers. Use Skatteverket's list of test personnummer (open data), never real or randomly generated ones. The examples on this page all come from that list, apart from the samordningsnummer, which is Skatteverket's own published example.
Sources
- Skatteverket, Personnummer (structure, sex digit, + separator, check digit).
- Skatteverket, Moving to Sweden and Coordination numbers.
- Skatteverket, Testpersonnummer, open data.
- Skatteverket, Organisationsnummer (SKV 709); group numbers from Swedish Wikipedia, Organisationsnummer.
- Pre-1990 county codes and dates that run out of numbers: Swedish Wikipedia, Personnummer i Sverige.
Last checked 7 October 2026. Lingolib is a Swedish course, not an authority: this page is independent and not affiliated with Skatteverket. Learning Swedish for life here? Try our Swedish numbers tool to read your personnummer aloud the way Swedes do, or start Season 1 of Complete Swedish, free in full with no account needed.
Frequently asked questions
What is the format of a Swedish personnummer?
Ten digits written YYMMDD-NNNC: your date of birth, a hyphen, a three-digit birth number and a check digit. Many systems store the 12-digit form YYYYMMDDNNNC, which spells out the century. The hyphen becomes a plus sign (+) the year you turn 100.
How is the last digit of a personnummer calculated?
With the Luhn algorithm (modulus 10). Multiply the first nine digits by 2, 1, 2, 1 … in turn, add up the digits of the products (12 counts as 1 + 2), and the check digit is whatever takes the total to the next multiple of ten.
What is the difference between a personnummer and a samordningsnummer?
You get a personnummer when you are entered in the Swedish Population Register (folkbokförd), normally because you will live in Sweden for at least a year. A samordningsnummer (coordination number) is for people who are not registered, for example someone working in Sweden for a few months. It looks the same, but 60 is added to the day of birth.
Does the personnummer show if you are a man or a woman?
Yes, under the current rules. Skatteverket says the last digit of the birth number (the ninth digit) is odd if your legal sex is man and even if it is woman. Making the numbers gender-neutral has been discussed in Swedish politics, but when we last checked no such change had been decided.
Is it safe to type my personnummer here?
The check runs only in your browser: nothing is stored, logged or sent to us or anyone else. You can even disconnect from the internet after the page has loaded. Still, a personnummer is personal data, so don't check numbers that belong to other people.
Where can I find test personnummer for software testing?
Skatteverket publishes a list of more than 40,000 test personnummer as open data. They are correctly formed but will never be issued to real people, so they are the right numbers to use in test systems and examples. Never generate random valid numbers: they may belong to someone.

