nullcipher

Swedish personnummer and samordningsnummer

YYMMDD-NNNC with a Luhn check digit; a samordningsnummer adds 60 to the day. Masked after a context word. Below: the exact rule, a live check, why it matters, and what to do if one already leaked.

Live check: Swedish personnummer

What an AI chat would receive after masking

Samordningsnummer: [PERSONNUMMER_1]

1 × Swedish personnummer found and masked.

How the number is built and checked

A personnummer is the date of birth as YYMMDD (the födelsetid), a three-digit birth number (födelsenummer) and a check digit. The last digit of the birth number is odd if the legal gender is male and even if it is female. A hyphen separates date and birth number; Skatteverket replaces it with a plus sign in the year the person turns 100, so 640823-3234 and 640823+3234 are born a century apart. [1]

The check digit, introduced in 1967, is the Luhn digit. Multiply the nine digits alternately by 2 and 1, add up the digits of the products, and the check digit brings the total up to the next multiple of 10. For 640823-323: 12, 4, 0, 8, 4, 3, 6, 2, 6 → 1+2+4+0+8+4+3+6+2+6 = 36, so the check digit is 4 and the number is 640823-3234. [3]

A samordningsnummer (coordination number), for people who are or have been without a Swedish population registration, is built the same way with 60 added to the day of birth: someone born on 3 October 1970 gets 701063-…, so the two kinds can never collide. Many systems also store the twelve-digit form with the century, 19640823-3234; nullcipher accepts both. [2]

Luhn catches every single mistyped digit, but 1 in 10 random ten-digit numbers pass it. So nullcipher only masks a personnummer-shaped number that follows one of its names — personnummer, samordningsnummer, personal identity number, coordination number — within 40 characters.

How nullcipher recognises it

YYMMDD-NNNC, YYMMDD+NNNC (the + is used from the year a person turns 100), YYMMDDNNNC or YYYYMMDD-NNNC with a real date, where C is the Luhn check digit over the ten digits YYMMDDNNN C. A samordningsnummer (coordination number) is the same with 60 added to the day. Luhn alone is passed by 1 in 10 random numbers, so it is only masked with a context word — personnummer, samordningsnummer, personal identity number or coordination number — within 40 characters before it.

This is the rule text of the “Swedish personnummer” detector in the masking engine, copied from the engine when this page was built. Detectors run in a fixed order and, where two overlap, the earlier one wins.

Example (fake)

Samordningsnummer: 701063-2391

nullcipher replaces it with [PERSONNUMMER_1]. This is the example Skatteverket prints on its samordningsnummer page: a man born on 3 October 1970, so the day 03 becomes 63. Its last digit passes the Luhn check. Delete the word in front of it in the live check and nullcipher leaves the number alone.

Why it matters in an AI chat

A personnummer identifies one person for life. Skatteverket changes it only when the registered birth date was wrong or the person changes legal gender, so a leaked number cannot be replaced the way a password can.

It also gives away the date of birth and the legal gender, so even with the name masked, an HR note or a support ticket that contains it still points at one person.

Pasting a payroll export, a customer list or a case note into an AI chat puts those numbers on someone else's servers. Masked, the AI still sees that [PERSONNUMMER_1] and [PERSONNUMMER_2] are two different people.

If it already leaked

  1. If you suspect that someone has used your personnummer, your ID or similar without permission, Skatteverket says to report it to the police. [4]
  2. Contact the credit reference agencies (kreditupplysningsföretag) and ask them to block your personnummer, so no one can take out credit in your name. [4]
  3. Skatteverket's page also points to its advice on protecting yourself against identity misuse, and to Integritetsskyddsmyndigheten (IMY) for questions or complaints about how your personal data was handled. [4]
  4. If it only went into an AI chat and there is no sign of misuse, delete the conversation — how, for each major assistant, is on the page listing every type. The number itself stays the same, so the steps above are about noticing and blocking misuse, not about replacing it.

Sources

  1. Personnummer — Skatteverket — checked 2026-09-23.
  2. Samordningsnummer — Skatteverket — checked 2026-09-23.
  3. Personnumret fyller 70 år — Statistics Sweden (SCB), with its table of how the check digit is calculated — checked 2026-09-23.
  4. Vad kan jag göra om jag har blivit utsatt för identitetsstöld? — Skatteverket — checked 2026-09-23.

Open the full masking tool to mask a whole log, .env file or e-mail — every type at once — and restore the values in the AI's answer. Or see all 30 secret types and how to delete a chat you already sent.