Norwegian National ID Generator & Validator (Fnr/D-number)
Generate and validate valid Norwegian national identity numbers (fødselsnummer, D-numbers) locally for testing.
History
How it works
A Norwegian national ID number is 11 digits: six for the birth date, three individual digits and two MOD11 check digits. A D-number adds 40 to the day, an H-number adds 40 to the month, and an FH-number (shared help number) starts with 8 or 9.
Synthetic test numbers add 80 to the month (months 81-92) so they can never collide with a real national ID number. This is the convention used by the Norwegian Tax Administration and Testnorge for synthetic test persons, often used as test patients in health IT.
Test data only. The numbers are randomly generated and mathematically valid, but belong to no real person. Use them for testing and development, never to impersonate anyone.
About this tool
A Norwegian national identity number (fødselsnummer) is an 11-digit number that identifies every person registered in the Norwegian population register. It consists of a date of birth (6 digits), an individual number (3 digits) and two check digits that verify the number is mathematically valid. This tool generates and validates ordinary fødselsnummer, D-numbers (for foreign workers), H-numbers (helper numbers used in health care) and FH-numbers (common helper numbers used in HL7 testing). Everything runs locally, numbers never leave the page, so you can safely use them for HL7 message tests, KYC flows or form validation.
How to use it
- Choose whether you want to validate an existing number or generate new ones.
- For validation: paste 11 digits. The tool answers yes/no and explains the type (fnr, D-, H- or FH-number).
- For generation: pick a type, an optional date of birth and gender, and how many numbers you need.
- Copy one number or download the whole list as test data.
Examples
150890-467-89550890-*****Common use cases
- Generating test persons for a health registry or HL7 integration.
- Validating form input during an application or onboarding process.
- Testing MOD11 implementations against known valid and invalid numbers.
- Filling test databases in development environments without touching real personal data.
- Teaching how the number is composed (date of birth, individual number, check digits).
- Sanity-checking a value received from a third party before looking it up in the population register.
Frequently asked questions
- Are the numbers safe to use as real personal data?
- No, the tool creates random, mathematically valid numbers that *may* belong to real people. Use only for testing and development, never as an identity in real systems.
- What is the difference between fnr, D-, H- and FH-numbers?
- Fnr is the "normal" fødselsnummer. D-numbers (day +40) are issued to foreigners with short-term stays. H-numbers (month +40) are helper numbers used in health care when no fnr exists yet. FH-numbers always start with 8 or 9 and are used for HL7 testing.
- How does the individual number encode sex and century?
- The third digit of the individual number (digit 9 overall) is even for females and odd for males. Together with the individual number’s range (000–999) it also encodes the century of birth, following rules set by the Norwegian Tax Administration.
- Is anything sent to the population register or other servers?
- No. All logic runs in JavaScript in your browser. The tool does not look anything up in the population register or any other service, and stores nothing.
Technical background
The check digits are computed with the MOD11 algorithm using two sets of weights: [3, 7, 6, 1, 8, 9, 4, 5, 2] for the first check digit and [5, 4, 3, 2, 7, 6, 5, 4, 3, 2] for the second. Each product is summed and taken modulo 11; the remainder is subtracted from 11 to yield the check digit, with special rules for remainder 0 (digit = 0) and remainder 1 (number is invalid). The rules are documented in the Norwegian Tax Administration’s population register specification and are publicly available. Numbers issued after 2032 will use an extended format to accommodate population growth.