Identifier detector
Norwegian fødselsnummer: format, validation and detection
Short answer
A Norwegian fødselsnummer has 11 digits: a birth date, a three-digit individual number and two modulus 11 check digits. D-numbers add 40 to the day, and H-numbers add 40 to the month.
What it is
The fødselsnummer identifies people in Norway. Maskflare's Norway pack covers it as a national ID, and the GDPR (EU/EEA) profile includes the pack.
In Maskflare this is the detector no_fodselsnummer, labelled "Norway - National identity number (fødselsnummer / D-number)", category national id number, in the Norway pack.
Format and layout
- 11 digits, usually DDMMYY followed by five digits: 15076500565.
- A day above 40 marks a D-number and a month above 40 marks an H-number; Maskflare subtracts 40 before checking the date.
- All 11 digits cannot be the same.
How the check works
The first check digit (tenth digit) is computed from the first nine digits with weights 3, 7, 6, 1, 8, 9, 4, 5, 2; the second (eleventh digit) from the first ten with weights 5, 4, 3, 2, 7, 6, 5, 4, 3, 2. Each is 11 minus the weighted sum modulo 11, with 11 counted as 0; if it would be 10 the number is rejected.
Valid and invalid examples
| Example | Result | Why |
|---|---|---|
15076500565 | Valid | Matches the layout and passes the validator. |
15076500560 | Invalid | The invalid example changes one character, the last character: 5 becomes 0. |
In running text the valid example reads, for instance, fødselsnummer 15076500565. The invalid one is left alone: a value that fails the validator is treated as an ordinary string.
Regex and validation caveats
- Two check digits make accidental passes rare, roughly one in a hundred for random numbers that already carry a valid date.
- A run with no space is masked unless a word like order or invoice sits closer to it than one of the detector's keywords (fnr, fodselsnummer, fødselsnummer).
- The validator rejects any number whose check digit would have to be 10.
Words that confirm it
The formatted shape is masked without a keyword. For a run with no separators, these words count as the detector's own keywords when a word like order, invoice or phone is also close: fnr, fodselsnummer, fødselsnummer, id no, id number, identity number, national id, personal id, personal number, personnummer. The nearer word wins.
How to detect it in LLM traffic
Norwegian fødselsnummer 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
- Strip spaces, dots and hyphens before running any arithmetic, but remember where they were so the original text can be replaced exactly.
- Match the shape with a pattern anchored on word boundaries, so that a long digit string is not read as several shorter Norwegian fødselsnummer candidates.
- 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.
- Treat a run with no separators more carefully than a formatted one: reject it when a word such as order, invoice, phone or reference is nearer to it than one of the identifier's own keywords.
- 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 Norway is a primary country.
- Monitor first: alert (counted, forwarded unchanged) when Norway 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 Norway pack, and applying it turns this detector on: GDPR - EU/EEA. For the GDPR (EU/EEA) profile the Norway 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
What is a D-number?
A temporary identifier for people without a permanent Norwegian number. Its day is the real day plus 40, which Maskflare's validator accounts for.
How many check digits does the fødselsnummer have?
Two, the tenth and eleventh digits, each computed with its own weights modulo 11.
Is the Norwegian fødselsnummer detector on by default?
It depends on the organisation's primary countries. It is part of the Norway pack, which the default Protect now template turns on with the action mask when Norway is a primary country.
Does a valid Norwegian fødselsnummer 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.