Skip to content

Identifier detector

German pension insurance number (RVNR): format, validation and detection

Updated Germanysocial security numberDetector key de_social_security

Short answer

The German pension insurance number has 12 characters: two area digits, a birth date, one letter, two digits and a check digit. The check weights the digits with 2, 1, 2, 5, 7, 1, 2, 1, 2, 1, 2, 1 and sums the digits of each product.

What it is

The Rentenversicherungsnummer (RVNR, also called social insurance number) identifies insured people in the German pension system. Maskflare's Germany pack covers it and the GDPR (EU/EEA) profile includes the pack. It appears in payroll and employment records.

In Maskflare this is the detector de_social_security, labelled "Germany - Pension insurance number (Rentenversicherungsnummer)", category social security number, in the Germany pack.

Format and layout

  • 12 characters: two digits, six digits (birth date as day, month, year), one capital letter, two digits, one check digit. Example layout: 12 010180 A 12 2.
  • The month part of the birth date must be between 01 and 12.
  • The letter is converted to its alphabet position (A is 01) for the check.

How the check works

Replace the letter with its two-digit position and the number becomes twelve digits long. Multiply them by 2, 1, 2, 5, 7, 1, 2, 1, 2, 1, 2, 1. Where a product has two digits, add the two digits together. Add everything up; the remainder after dividing by 10 is the check digit.

Valid and invalid examples

Synthetic values. Each was run through Maskflare's own validator and pattern when this page was generated.
ExampleResultWhy
12010180A122ValidMatches the layout and passes the validator.
12010180A120InvalidThe invalid example changes one character, the last character: 2 becomes 0.

In running text the valid example reads, for instance, RVNR 12010180A122. The invalid one is left alone: a value that fails the validator is treated as an ordinary string.

Regex and validation caveats

  • Only the month is range-checked; the day is not validated against the calendar, so the check digit does most of the filtering.
  • The detector has no context words. The letter in the middle makes the shape unusual, which keeps random matches down.
  • The number reveals a birth date and a registration area, so it is personal data on its own.

How to detect it in LLM traffic

German pension insurance number (RVNR) values reach an LLM inside ordinary work rather than as standalone data: a pasted block of HR or payroll rows, a customer-support thread, an onboarding or identity-check form, a spreadsheet someone wants summarised, or an email they want rewritten. The model needs none of the digits for any of those jobs, so the safest place to remove them is before the request leaves the company.

Maskflare reads the whole request body, including the system prompt, earlier messages and tool arguments, so a number buried in the fourth message of a long chat is found as readily as one in the latest message. Each match is replaced with a token such as mf_mask_d7e0 before the request goes out, and with response restoration turned on the real value is put back into the answer for the person who is allowed to see it.

If you build the detection yourself

  1. Strip spaces, dots and hyphens before running any arithmetic, but remember where they were so the original text can be replaced exactly.
  2. Match the shape with a pattern anchored on word boundaries, so that a long digit string is not read as several shorter German pension insurance number (RVNR) candidates.
  3. Run the check from the section above. A failing check is almost always a typo or a made-up value; a passing one removes most look-alikes.
  4. Replace the value before the text is sent anywhere, and keep a mapping if the answer has to be restored afterwards.

How Maskflare handles it

  • Protect now, Finance - Protect now, Healthcare and Developer: mask (a reversible token) when Germany is a primary country.
  • Monitor first: alert (counted, forwarded unchanged) when Germany is a primary country.

The available actions are mask (reversible token), redact, partial, hash, format-preserving encryption, generalize, alert and block. Masked values are kept encrypted for 30 days so that answers can be restored, then they expire; prompts and responses are not logged. The full list of detectors is in the detector reference.

Compliance profiles that include it

One compliance profile includes the Germany pack, and applying it turns this detector on: GDPR - EU/EEA. For the GDPR (EU/EEA) profile the Germany pack is one of the country packs the administrator can choose from; the profile turns on the ones chosen. A profile is a floor: it never turns anything off or weakens a rule that is already stricter.

Frequently asked questions

Does the detector read the letter in lower case?

Yes. The validator upper-cases the characters before checking, so a lower-case letter is accepted.

Is the RVNR the same as the health insurance number?

No. The health insurance number (KVNR) is a letter plus nine digits and has its own detector in the health pack.

Is the German pension insurance number (RVNR) detector on by default?

It depends on the organisation's primary countries. It is part of the Germany pack, which the default Protect now template turns on with the action mask when Germany is a primary country.

Does a valid German pension insurance number (RVNR) prove the person exists?

No. A check digit shows the value is well formed. Many valid-looking numbers have never been issued, and Maskflare masks them all the same.

Rules on this page describe what Maskflare's detectors and validators check. They are read from the detection catalogue and are not the specification of the body that issues the identifier. Examples are synthetic.

Related pages

See it on your own data

Try Maskflare free.
Bring your hardest prompts.

28-day free trial or 10,000 requests, whichever comes first. Point one app at the gateway or enroll a few laptops,
and watch what gets masked. Or talk to us first.