French Social Security Key Calculator (Clé NIR)
Enter the first thirteen characters of a French social security number and get the two-digit control key that completes the 15-character NIR. The page shows the calculation step by step, handles Corsica's 2A and 2B, and copies the full number in one click. Everything runs in your browser and nothing is sent.
Processed locally in your browser/ Your data stays in your browser.
What is French Social Security Key Calculator (Clé NIR)?
The last two digits of a French social security number (NIR) are a control key, often called the clé. It is not secret and not random: it is computed from the first 13 characters so that typing mistakes can be detected. Anyone who knows the 13 characters can work the key out, which is why this calculator needs nothing else.
The formula is key = 97 − (the 13-digit number mod 97). If the number contains 2A or 2B for a birth in Corsica, 2A is replaced by 19 and 2B by 18 for the division. The result is between 1 and 97 and is written on two digits, so 7 becomes 07.
How does it work?
- Type the first 13 characters: sex, birth year, birth month, département, commune and order number. Spaces are ignored and Corsica's 2A and 2B are accepted.
- The tool divides the number by 97 and keeps the remainder.
- It subtracts the remainder from 97 and adds a leading zero when the result has one digit; a remainder of 0 gives 97.
- Copy the key on its own or the full 15-character number.
Common use cases
- You have a 13-character number from a form or a database and need the key that completes it.
- You are generating or checking test data for a payroll, HR or health application.
- You want to see the modulo 97 calculation worked out to understand or implement it.
- The key on a document is unreadable and you want to check what it should be.
Examples
Try this input in the tool above:
1 84 12 76 451 089
Control key: 46 Full number: 1 84 12 76 451 089 46 Sex: 1 (male) Birth year (2 digits): 84 Birth month: 12 (December) Département: 76 Commune: 451 Order number: 089
Privacy
French Social Security Key Calculator (Clé NIR) runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.
Limitations
The control key protects against typing errors, not against fraud: it says nothing about whether a number was issued. A social security number is personal data, and in France its use by organisations is regulated. Use this tool to complete or check numbers you are entitled to handle.
Frequently asked questions
How is the French social security key calculated?
The key is 97 minus the remainder of the first 13 digits divided by 97. A remainder of 0 gives 97, and a single-digit result is written with a leading zero, such as 07.
What about people born in Corsica?
Their département code is 2A or 2B. For the calculation, 2A is replaced by 19 and 2B by 18, then the usual formula is applied.
Can I find someone's key from their name or date of birth?
No. The key depends on all 13 characters, including the commune and order number, which cannot be guessed from public information. This tool only completes a number you already have.
Is the key secret?
No. It is a public check value derived from the other 13 characters and exists only to detect typing errors.
Related tools
French Social Security Number (NIR) Validator
Paste a French social security number, the 15-character NIR printed on a carte Vitale or an attestation, and check that its two-digit control key matches the first thirteen characters. The result also breaks the number into sex, birth year, month, département and commune. Everything runs in your browser and nothing you type is stored or sent.
Developer Tools
CRC32 & Adler-32 Calculator
Compute a CRC-32 (IEEE 802.3) or Adler-32 checksum and read it as hex, decimal or Base64.
Hash & Checksum
Hash Verifier
Paste the checksum you were given, drop the file, and see whether they match.
Hash & Checksum
Base Converter (Base 2 to 36)
Type a number, pick its base and the base you want, and get an exact result with a quick view in binary, octal, decimal, hexadecimal and base 36.
Developer Tools
UUID Validator & Version Detector
Paste one or many UUIDs to see which ones are valid, which version each is and, for time-based versions, when it was created.
Developer Tools
Regex Tester
Write a pattern, paste some text and see every match highlighted, with its position and capture groups.
Developer Tools