Denmark CPR Numbers: GDPR Compliance Guide
Updated for 2026
Denmark's data watchdog, Datatilsynet, issued 31 GDPR decisions in 2024. Fourteen involved healthcare data. That high share reflects two facts: Denmark runs a large national health system, and technical gaps in that system keep exposing patient records.
The Check-Digit Rule for CPR Numbers
A CPR number is Denmark's personal ID. It is 10 digits in DDMMYY-XXXX format. The first six digits are the birth date. The last four are a code plus a check digit.
The check digit uses a modulus-11 rule:
- Take digits 1 to 9.
- Give each a weight: 4, 3, 2, 7, 6, 5, 4, 3, 2.
- Multiply each digit by its weight. Add all results.
- Divide by 11. Note the remainder.
- Remainder 0 → check digit is 0.
- Remainder 1 → the number is not valid.
- Remainder 2–10 → check digit is 11 minus the remainder.
This rule matters for any tool that scans for CPR numbers. Some DDMMYY-XXXX strings can never be valid. Tools that skip this step flag dates, invoice codes, and reference numbers as real IDs.
The authority's 2024 review found that 67% of generic NLP tools skip this check. That gap is the top technical failure in its healthcare cases.
Denmark's Five Health Registries
Denmark links health data across five national registries. The personal ID ties all five together.
- Hospital discharge records (from 1977)
- Prescription data (from 1995)
- Cancer registry (from 1943)
- Cause of death registry (from 1970)
- Primary care diagnoses (from 1990)
This makes Danish health research very strong. It also creates a risk. Removing the raw ID is not enough. A dataset that still holds age, sex, diagnosis, and year can re-expose people — especially those with rare conditions.
Datatilsynet's 2024 guidance on secondary health data use sets three requirements.
Write down what you did to the data: List which fields you removed, which you rounded or grouped, and what group size the output achieves. A policy note does not meet this standard.
Get an outside review for large sets: For datasets with more than 5,000 people, the authority recommends an independent technical review of the de-identification steps.
Match the data to the question: The dataset must fit the stated research goal. The authority found cases where teams used full national registries when a smaller sample would have worked.
See our EU national ID detection guide for how check-digit rules apply to other European ID formats.
What the 2024 Cases Found
The 14 healthcare cases share three common failure types.
Research data sharing: A hospital sends a de-identified patient dataset to an academic partner for AI training. The set holds birth date parts, diagnosis codes, and treatment dates. The authority finds this mix re-exposes patients with rare diseases. Unusual diagnoses narrow the pool fast.
Third-party AI services: A health tech firm sends patient notes to a US-based AI service for clinical records work. Personal IDs in those notes are not removed first. No valid transfer mechanism is in place.
OCR pipeline gaps: An insurer processes scanned PDF forms for disability claims. Its OCR tool converts images to text. But it does not run check-digit tests on the output. Many IDs are missed.
OCR often inserts spaces mid-number or shifts the dash. Simple pattern matching breaks on that output. Detection must work on OCR text, not just clean input. See our OCR healthcare detection guide for steps to handle scanned documents.
Three Technical Must-Haves
These three elements form the base for Danish healthcare GDPR compliance.
Check-digit tests on all text: Run the full modulus-11 check on every candidate string. Apply it to clean text and OCR output alike.
Danish-language name detection: Use a model trained on Danish text. The spaCy da_core_news model is one option. A generic English model misses Danish names and org names.
De-identification records: Write down what was removed, what was grouped, and the output's group size. The authority asks for this in technical form, not as a policy note.
For data on the cost of healthcare data incidents, see our healthcare breach cost analysis.