Sweden Personnummer Generator
Generate Swedish personal identity numbers (YYMMDD-NNNC) with a valid birth date and Luhn check — synthetic test data only
For Development & Testing Purposes Only - Synthetic Mock Data
Settings
1 valueGenerates one value with a valid checksum. Press ⌘/Ctrl+Enter for a fresh one.
Generated value
No value yet
Set options, then press Generate.
Generated values are valid in shape but randomized (Test Data).
Examples
Generate a personnummer
Personnummer · Generate811218-9876Birth date 18 December 1981 and serial 987; the final 6 is the Luhn check digit.
Validate a pasted value
811218-9876Valid — Luhn check digit 6The validator recomputes Luhn over the ten digits after removing the hyphen.
Reject a wrong check digit
811218-9877Invalid — bad check digit: expected 6, found 7The failure names the expected digit instead of rejecting the format.
About this tool
The Sweden Personnummer Generator produces one personal identity number in the YYMMDD-NNNC layout: a birth date, a three-digit serial and a Luhn check digit. The third serial digit is odd for men and even for women, so the generated value carries a consistent gender marker.
A plus sign instead of a hyphen marks people aged 100 or over. Generation picks a real birth date and derives the Luhn digit over the ten digits, and validation reports an impossible date before it checks that digit.
These are synthetic values for QA and development, never for real applications, KYC checks, tax filings, identity documents or impersonation. A random value can coincide with a real, issued number, and DevTools accepts no liability for how generated data is used. Everything runs locally in your browser.
What this tool does not do
- Generates personnummer only; organisation numbers live in a separate tool.
- The tool does not assign a specific birth date or gender on request.
- Validation checks structure and Luhn, not whether the number is in use.
- A random value can coincide with a real person's number.
How to use this tool
Choose the personnummer option
The tool is pinned to the Swedish personnummer, which uses YYMMDD-NNNC with a Luhn check digit.
Generate a value
Click Generate to create one number with a real birth date, a three-digit serial and a valid check digit.
Validate or copy
Switch to Validate to check a pasted personnummer, or copy the result and download it as a .txt file.
Use cases
Onboarding identity fields
Fill Swedish identity fields with a personnummer that has a real birth date and a valid Luhn digit.
Payroll fixtures
Seed payroll and benefits screens that require a personal identity number for test employees.
Date validation tests
Pair a valid value with an edited month or day to cover the birth-date rejection path.
Personnummer structure
| Part | Rule |
|---|---|
| Layout | YYMMDD-NNNC |
| Birth date | A real calendar date |
| Serial | 3 digits; third digit odd for men, even for women |
| Check digit | Luhn over the ten digits |
| Separator | Hyphen normally; plus sign for people aged 100 or over |
811218-9876 is the layout example used by the tool and its tests.
Common mistakes
Mistake:Reading the serial as random
Fix:The third serial digit encodes gender, so odd and even serials behave differently.
Mistake:Skipping the birth date check
Fix:The validator rejects impossible dates such as month 13 before the Luhn step.
Mistake:Using the plus sign for anyone
Fix:A plus sign marks people aged 100 or over, not a formatting preference.
Frequently asked questions
Are these real Swedish personnummer?
No. Every value is synthetic test data for QA and development and must not be used for real applications, KYC checks, tax filings, healthcare, or identity documents; DevTools accepts no liability for their use.
Does the serial number encode gender?
Yes. The third digit of the three-digit serial is odd for men and even for women, so a generated value always carries a consistent gender marker.
What does a plus sign instead of a hyphen mean?
A plus sign marks a person aged 100 or over. The validator accepts both separators and resolves the century from the sign when the year is given as two digits.
Can a generated personnummer match a real person?
It can. The Luhn check only confirms the number is well formed, so a random value may coincide with a real person's number. Keep generated values in test environments only.
What happens if the birth date is impossible?
The validator reports the bad month or day before it evaluates the Luhn digit, so an edited date such as month 13 fails with a date error rather than a checksum error.
References & standards
Related tools
Sweden Organisationsnummer Generator
Generate synthetic 10-digit Swedish organisation numbers with the third digit rule and a Luhn check digit.
SEPA IBAN Generator
Generate SEPA-eligible IBAN and BIC pairs with ISO 7064 Mod 97-10 checks.
VAT Number Generator
Generate VAT numbers for EU, UK, Switzerland, Norway and global tax integration testing.
National Identity Generator
Generate and validate national ID numbers for testing (TR, US, DE, UK, SA, AE, QA, KW, CA, ES, BR, FR, IT, NL, SE, NO, EG, SG)
Tax ID Validator
Auto-detect and validate VAT, EIN, TIN and GST identifiers with batch checksum reporting.