Sweden Personnummer Generator
Generate and validate Swedish personal identity numbers (personnummer) with Luhn algorithm validation.
Generator Settings
Validate Personnummer
Personnummer Format
Short: YYMMDD-XXXX
Long: YYYYMMDD-XXXX
Separator: - (under 100) or + (100+)
9th digit: Gender (odd=male)
10th digit: Luhn check digit
β οΈ Testing Only
Generated numbers are mathematically valid but fictitious. For testing and development purposes only.
What is This Tool?
A Swedish personnummer generator creates fictional 10-digit (or 12-digit) personal identity numbers in the format used by Skatteverket. Every personnummer encodes a date of birth, a gender digit, a region code, and a Luhn check digit β and this tool produces values that pass all of those validations without belonging to any real person.
The personnummer is required for almost every Swedish bank, healthcare, employment, and tax interaction, so software that handles Swedish customers must be tested with values that exercise the full format. Use this generator for that β never for real registrations.
How the Personnummer Algorithm Works
A personnummer is structured as YYMMDD-NNNC where the last digit C is a Luhn check digit calculated from the preceding 9 digits. The separator is - for people under 100 and + once they turn 100.
- Take the 9 digits before the check digit (e.g., for
811228-9876, take811228987). - Multiply each digit alternately by 2 and 1, starting with 2 on the leftmost digit.
- If any product is β₯ 10, add the two digits together (so 14 becomes 1+4=5).
- Sum all the resulting values.
- The check digit is
(10 β (sum mod 10)) mod 10.
Worked example for 811228-987C:
8Β·2 + 1Β·1 + 1Β·2 + 2Β·1 + 2Β·2 + 8Β·1 + 9Β·2 + 8Β·1 + 7Β·2
= 16 + 1 + 2 + 2 + 4 + 8 + 18 + 8 + 14
= (1+6) + 1 + 2 + 2 + 4 + 8 + (1+8) + 8 + (1+4) = 47
Check digit = (10 β (47 mod 10)) mod 10 = 3, so the full personnummer is 811228-9873.
The 9th digit indicates gender β odd for male, even for female. Digits 7-9 (the "birth number") were historically tied to county of birth but have been issued nationally since 1990.
Common Use Cases
Swedish Banking & Fintech QA
Test BankID flows, Klarna integrations, account opening forms, and KYC checks against the Swedish identity format.
Healthcare & 1177 Systems
Validate patient lookup, journal access, and Region/Landsting integrations that use personnummer as the primary key.
E-commerce Checkout Testing
Test invoice (faktura) and pay-later flows where Swedish merchants ask for personnummer to run a credit check.
HR & Payroll Systems
Test Skatteverket payroll filings (AGI), pension contributions, and onboarding flows for Swedish employees.
Frequently Asked Questions
What is a Swedish personnummer?
A personnummer is the Swedish personal identity number β 10 digits in the format YYMMDD-NNNN (or 12 digits with century: YYYYMMDD-NNNN). The last digit is a Luhn check digit and the third-to-last digit indicates gender (odd = male, even = female).
How is the personnummer check digit calculated?
It is the Luhn algorithm applied to the 9 preceding digits (YYMMDD-NNN). Each digit is multiplied alternately by 2 and 1, digits over 9 are summed, the total is taken modulo 10, and the result is subtracted from 10.
What is the difference between personnummer and samordningsnummer?
A samordningsnummer (coordination number) is given to people who do not qualify for a permanent personnummer but need a Swedish identifier. It looks similar but adds 60 to the day-of-month β so the 15th becomes 75.
When does the separator change from β to +?
The hyphen (β) is replaced by a plus sign (+) on the year the person turns 100. This is how a 10-digit personnummer disambiguates people born 100 years apart who would otherwise share the same digits.