How the number is built and checked
A CPR number is ten digits: day, month and two-digit year of birth, then a four-digit serial number (løbenummer). The last digit is odd for men and even for women. [1][3]
The year has no century, so the CPR office reads it from the 7th digit: 0–3 means 1900–1999; 4 or 9 means 2000–2036 when the year is 00–36 and 1937–1999 otherwise; 5–8 means 2000–2057 for years 00–57 and 1858–1899 for 58–99. 070761-4285 has a 4 and the year 61, so it belongs to someone born on 7 July 1961. [3]
Until 2007 every CPR number passed a modulus-11 check: multiply the digits by 4 3 2 7 6 5 4 3 2 1 and the sum is divisible by 11. For 070761-4285 that is 0+21+0+49+36+5+16+6+16+5 = 154 = 14 × 11. Since 2007 the CPR office also issues numbers that fail it, because on busy birth dates — 1 January above all — the numbers that pass ran out. It says these are fully valid and must be accepted, so there is no check digit you can rely on. [2][3]
That leaves the date as the only test, and about 1 in 27 random six-digit strings are a real DDMMYY. So nullcipher masks a CPR-shaped number only when CPR, CPR-nr or personnummer stands within 40 characters before it. Swedes say personnummer too: a number after that word which also passes the Swedish Luhn check is labelled Swedish, and it is masked either way.
How nullcipher recognises it
DDMMYY-SSSS, DDMMYY SSSS or ten digits, where DDMMYY is a real date once the century is read from the 7th digit (0–3: 1900s; 4 or 9: 2000–2036, otherwise 1937–1999; 5–8: 2000–2057, otherwise 1858–1899). There is no check digit to test: the CPR office has issued numbers that fail the old modulus-11 check since 2007. So it is only masked with a context word — CPR, CPR-nr, personnummer — within 40 characters before it.
This is the rule text of the “Danish CPR number” 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)
CPR-nr. 070761-4285
nullcipher replaces it with [CPR_1]. This is the worked example the CPR office itself uses to show the old modulus-11 calculation in “Personnummeret i CPR-systemet”. Delete “CPR-nr.” in the live check and nullcipher leaves the number alone: without a context word ten digits are just ten digits.
Why it matters in an AI chat
The CPR number is the key Danish authorities, hospitals, banks, pension funds and employers use to find a person. The CPR office says an assigned number is never reused and always follows its holder; a new one is only issued if the birth date or sex in it was wrong.
It gives away the date of birth and the sex, so a masked name next to an unmasked CPR number protects very little. Patient notes, HR files and customer tickets carry it routinely.
Pasted into an AI chat, the number leaves your machine together with whatever it sits next to. Masked, the AI still sees that [CPR_1] is one person and can reason about the case.
If it already leaked
- Register a kreditadvarsel (credit warning) on your CPR number through the self-service on borger.dk, or at your municipality's citizen service if you cannot use it; you must be at least 15. Lenders then take extra care and may refuse credit if they suspect identity fraud. It is not permanent: you can remove it before applying for a loan yourself and register it again afterwards. [4]
- If the number has been misused, report it to the police, and contact the companies or authorities involved — on their main number, not one given in a message you received. [5]
- Sikkerdigital.dk notes that you are rarely liable for agreements you did not make yourself, but that clearing up identity theft can be a long and draining process — another reason to register the credit warning early. [5]
- 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
- Opbygning af CPR-nummeret — CPR-kontoret — checked 2026-09-23.
- Personnumre uden kontrolciffer (modulus 11 kontrol) — CPR-kontoret — checked 2026-09-23.
- Personnummeret i CPR-systemet (PDF, 1 July 2008) — CPR-kontoret: the century table and the modulus-11 worked example — checked 2026-09-23.
- Kreditadvarsel — CPR-kontoret — checked 2026-09-23.
- Identitetstyveri — Sikkerdigital.dk (Danish Agency for Digital Government) — 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.