By · Last updated 2026-05-29

Back to BlogGDPR & Compliance

Denmark CPR: Modulus-11 Validation for GDPR

67% of NLP tools miss Danish CPR-number modulus-11 validation. Datatilsynet's 14 healthcare enforcement actions in 2024. Secondary use of health data.

May 29, 20267 minute read
Denmark DatatilsynetCPR modulus-11Danish healthcare GDPRhealth data anonymizationNordic compliance

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:

  1. Take digits 1 to 9.
  2. Give each a weight: 4, 3, 2, 7, 6, 5, 4, 3, 2.
  3. Multiply each digit by its weight. Add all results.
  4. Divide by 11. Note the remainder.
  5. Remainder 0 → check digit is 0.
  6. Remainder 1 → the number is not valid.
  7. 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.

Sources

Ready to protect your data?

Start anonymizing PII with 285+ entity types across 48 languages.

About this page

We update this page when our platform or the law changes.

Read our founder note for how we work.

Each change shows up in the timestamp at the top.

Related reading

We follow these rules

  • GDPR (EU 2016/679).
  • ISO/IEC 27001:2022.
  • NIS2 (EU 2022/2555).
  • HIPAA safe harbor under 45 CFR § 164.514(b)(2).

Our promise

We do not sell your data.

We do not train models on your text.

We store your files in Germany.

You can delete your account at any time.

You own your work.

Where we run

Our servers live in Falkenstein, Germany.

We use Hetzner. They hold ISO 27001 certification.

All data stays in the EU.

Backups run every day.

Need help?

Email support@anonym.legal.

We reply within one business day.

How we test

We run a full check suite on every release.

Each surface gets its own sweep script and report.

Human reviewers spot-check the output each week.

We track recall and precision on a labelled set.

Bad runs block the deploy.

What we never do

  • We never sell your information to third parties.
  • We never train models on what you upload.
  • We never keep your work after you delete it.
  • We never share keys with any outside firm.
  • We never run ads inside the product.

Plans in plain words

We sell credits, not seats.

One credit covers one short job.

Long jobs use a few credits each.

You can top up at any time.

Unused credits roll over each month.

Read the plans page for current rates.

Who built this

A small team of engineers and lawyers built this.

We ship from Europe and work in the open.

Our founder note spells out why we started.

Where to start

How the parts fit

A browser add-on cleans text inside Chrome.

A Word plug-in handles drafts in Office.

A small desktop tool works on whole folders.

An agent protocol link feeds large models safely.

All four share one core engine and one rule set.

Words from our team

We started this work after a lunch about cookies.

One friend kept getting odd ads on her phone.

We asked why a court file leaked through a draft.

We sketched the first build on a napkin that week.

By month three we had a tiny demo for a friend.

She used it on her first case the next day.

Common questions we hear

Can the tool read scanned PDFs? Yes, with OCR.

Does it work on long files? Yes, in small chunks.

Can I roll my own rule set? Yes, save it as a preset.

Does it run offline? The desktop build runs offline.

Do you keep my files? No, the cloud build wipes after each run.

Will it learn from my work? No, we never train on inputs.

A short tour of the workflow

Upload a file or paste a snippet of prose.

Pick the entities you want gone from the draft.

Choose a method: replace, mask, hash, encrypt, or redact.

Press run and watch the side panel show each hit.

Skim the result and tweak any rule that misfired.

Save the cleaned file or send it to a teammate.