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.
When This Approach Has Limits
Running the modulus-11 check on every candidate string, including OCR output, plus Danish-language name detection is the right technical baseline for CPR numbers — that part of the approach is sound. But limits remain worth stating plainly.
Detection accuracy bounds the result, and OCR makes it harder. The check digit only helps once a candidate has been surfaced. Scanned disability and insurance forms shift the dash, insert spaces mid-number, or split a CPR across lines, and a number the pattern stage never recognized never reaches the modulus-11 test. The residual false-negative rate on real OCR output sets the ceiling on coverage. Validate recall on your own scanned documents rather than on clean text, because performance on typed input does not predict performance on degraded images.
Quasi-identifiers can re-identify across the five registries. Denmark's strength — linking hospital, prescription, cancer, death, and primary-care data through one ID — is also the risk. Removing the raw CPR is not enough when age, sex, diagnosis, and year remain, especially for rare conditions that narrow the pool to a single person. Such a dataset is pseudonymized, not anonymized, and stays in scope. Datatilsynet requires documented field-level de-identification and, for sets over 5,000 people, an independent technical review — neither of which a detector produces on its own.
The tool supports compliance but does not constitute it. Accurate CPR detection is one technical measure; Datatilsynet audits the whole posture, including transfer mechanisms for third-party AI services, purpose limitation, and the de-identification records it asks for in technical rather than policy form. The authority's healthcare cases turned on missing transfer safeguards and undocumented method, not only on detection. The controller still owns human review and accountability around the detection layer.