Danish CPR Number Generator & Validator
Generate MOD11-valid Danish CPR numbers and validate structure, date and MOD11 locally for testing.
History
How it works
A Danish CPR number is 10 digits: six for the birth date (DDMMYY) and four serial digits. The last digit indicates gender (odd for men, even for women), and the seventh digit, together with the year, determines the century of birth.
Historically the CPR number had a MOD11 check digit. Since 2007 Denmark also issues numbers that are NOT MOD11-valid, because the valid ones ran out for some dates. This tool therefore generates MOD11-valid test numbers, but when you validate, structure and a valid date decide the outcome. The MOD11 status is shown only as extra info, so that real modern CPR numbers are not wrongly rejected.
Test data only. The numbers are randomly generated but belong to no real person. Use them for testing and development, never to impersonate anyone.
About this tool
A Danish personal identity number (CPR number, Det Centrale Personregister) is 10 digits in the format `DDMMYY-XXXX`. The first six digits are the birth date (day, month, two-digit year), and the last four form a serial where the final digit historically was a modulo-11 check digit. From October 1, 2007 the check-digit rule was officially abolished because not enough valid numbers remained for certain dates. CPR is issued by the CPR office under the Ministry of Interior to everyone registered in Denmark. The tool validates syntax, checks the birth date, extracts century (via the first digit of the serial) and sex (even = female, odd = male). Everything runs locally.
How to use it
- Paste or type the CPR number into the input field.
- Both with and without hyphen are accepted (`010190-1234` or `0101901234`).
- The tool checks that there are 10 digits and that the birth date is valid.
- For a valid number, birth date, age and sex are shown.
- Everything happens locally, CPR numbers never leave your browser.
Examples
010190-2003✓ Valid · b. 01.01.1990 · Male150507-4234✓ Valid · b. 15.05.2007 · Female320190-1234✗ Invalid date of birth (there is no 32 January)Common use cases
- Customer databases in Danish SaaS and e-commerce.
- HR systems and payroll for Danish employees.
- NemID/MitID integrations where CPR must be validated.
- Healthcare and record systems (Sundhedsplatformen, EHR).
- Government services like skat.dk, borger.dk, municipal solutions.
- Age validation (18-year limit for alcohol, gambling, tobacco).
Frequently asked questions
- Why doesn’t the mod-11 check work anymore?
- With the mod-11 rule, only about 90 % of theoretically possible numbers were valid (10 out of 11). For certain birthdays with many births (especially January 1), numbers ran out, there weren’t enough valid mod-11 numbers to allocate. The CPR office abolished the rule on October 1, 2007, and new numbers are allocated without check-digit validation. Old numbers can still validate with mod-11.
- How do I find the century?
- The first digit of the serial (position 7 of 10) determines the century combined with the two-digit year. Digits 0–3: 1900s. Digit 4–9: 1900s if year ≥ 37, else 2000s. Digit 5–8: 1800s if year ≥ 58, else 2000s. Digit 9: 1900s if year ≥ 37, else 2000s. This is the table the CPR register uses.
- Is CPR sensitive under GDPR?
- Yes. CPR is directly identifying personal data under GDPR and has specific rules in the Danish Data Protection Act (§ 11). Processing is often only permitted for public authorities, employers, banks and others with legal basis. Private businesses must have "explicit consent" or legal ground. Never use CPR as a reference in customer correspondence.
- Can a CPR be changed or revoked?
- CPR is meant to be permanent. On gender change, the person receives a new CPR with corrected sex digit (even/odd). In identity theft cases, the CPR office may exceptionally issue a new number. Adoption and name change don’t alter the CPR. On death, CPR is marked "deceased" but not removed from the register.
Technical background
Historical MOD-11: weight vector is (4, 3, 2, 7, 6, 5, 4, 3, 2, 1) from the left. Sum digitᵢ × weightᵢ over all 10 digits. The number was valid if the sum was divisible by 11. Since 2007 the rule is officially abolished, but many systems still check old numbers with it. Birth-date validation: day must be 01–31, month 01–12, and the date must be valid for the year (leap years handled for February). Sex: last digit even = female, odd = male. Century is determined by first digit of the serial + two-digit year (see FAQ table). API access: the CPR register is not public; businesses need an agreement with Datafordeleren to look up name/address by CPR.