CheckIDs Try the redaction API

🇸🇪 Personnummer validator

Also in: Svenska

The Swedish personnummer is written YYMMDD-NNNC (or YYYYMMDD-NNNC). It encodes the date of birth and sex, and ends with a Luhn check digit. This validator also accepts samordningsnummer (coordination numbers).

Runs entirely in your browser; nothing you type is sent anywhere.

Generate test personnummer numbers

Fictional numbers with correct check digits, for testing software. They may by chance match a real person's number, so never use them to identify or impersonate anyone.

Click a number to copy it.

How a personnummer is structured

How the check works

Using the published example 811228-9874:

Take the 10 digits YYMMDDNNNC and double every other digit starting with the first (subtracting 9 when the result is above 9): 8→7, 1, 1→2, 2, 2→4, 8, 9→9, 8, 7→5, 4. Their sum is 50, which ends in 0, so the Luhn check passes. The last digit is chosen to make this true.

A passing check only means the number is well-formed; it doesn't prove the number was issued to anyone.

Finding personnummer numbers in text? The EU PII Redaction API finds and replaces national ID numbers from 21 EU/EEA countries, plus names, IBANs, emails and phones, in free text: for example before sending customer messages to an LLM. Free plan available; Python package and MCP server on GitHub.

Frequently asked questions

What is a samordningsnummer?

A coordination number for people who are or have been in Sweden without being registered as residents. It looks like a personnummer with 60 added to the day of birth.

Why is there sometimes a plus sign?

The '-' becomes '+' in the year a person turns 100, so the century stays unambiguous in the 10-digit form.

Other validators