French social security number key
key = 97 − (N mod 97), where N is the number formed by the first 13 characters (2A → 19, 2B → 18)
Calculate the control key of a French social security number (NIR) from its first 13 characters, Corsica included, or check a 15-character number, without sending anything to a server.
Sex, year, month, place of birth and order number, without the key. Spaces and dots are accepted.
The 13 characters followed by the 2-digit key. For Corsica, type 2A or 2B.
A correct key only proves that the number is consistent, not that it was issued or to whom. The calculation runs in your browser: the number is not stored, sent or tracked.
The French social security number, officially called NIR (numéro d’inscription au répertoire), has 13 characters followed by a 2-digit control key. The key is not a second number: it is calculated from the first 13 characters to catch typing errors. This tool calculates a missing key or checks a complete 15-character number with the method published by INSEE, the French statistics institute, including people born in Corsica (2A, 2B), in the overseas departments or outside France.
The first 13 characters are read as one number: sex (1 digit), year of birth (2), month (2), place of birth (5) and order number (3). Spaces, dots and hyphens are ignored.
For a Corsican department, INSEE replaces the letter with 0 and then subtracts 1,000,000 for 2A or 2,000,000 for 2B, which amounts to calculating with 19 instead of 2A and 18 instead of 2B.
The resulting number is divided by 97. The key is the complement to 97 of the remainder: 97 minus the remainder, written on two digits (01 to 97).
In check mode, the tool recalculates the key of the first 13 characters and compares it with the last two digits entered. If they differ, it shows the expected key.
Calculate the key from 13 characters, or check a complete 15-character number.
Type it with or without spaces, keeping 2A or 2B for a Corsican department.
The tool shows the formatted number and its key, then the sex, month and year of birth and place of birth encoded in it.
key = 97 − (N mod 97), where N is the number formed by the first 13 characters (2A → 19, 2B → 18)
Written on two digits, the key ranges from 01 to 97. The check catches any single-digit error and any swap of two adjacent digits.
Spot a typo in an employee’s French social security number before saving it in payroll software or a declaration.
When the last two digits are blurred on a copy of a Carte Vitale or certificate, the key can be recalculated from the first 13 characters.
Make sure your own input validation handles Corsica and births abroad correctly, using fictitious numbers.
1841276451089 divided by 97 leaves a remainder of 51, so the key is 97 − 51 = 46. The number describes a man born in December 1984 in department 76.
Input
First 13 characters of the number: 1 84 12 76 451 089Result
Key calculated: 46; complete number: 1 84 12 76 451 089 46The calculation uses 1751219345678, where 2A is replaced by 19 as the INSEE method requires.
Input
First 13 characters of the number: 1 75 12 2A 345 678Result
Key calculated: 58Swapping the two digits of the key is enough to make the number inconsistent.
Input
Complete social security number: 1 84 12 76 451 089 64Result
Wrong key: the expected key is 46.Divide the first 13 digits by 97 and keep the remainder. The key is 97 minus that remainder, on two digits. For example, 1841276451089 leaves a remainder of 51, so the key is 46.
INSEE replaces the letter with 0 and subtracts 1,000,000 for 2A and 2,000,000 for 2B. In practice, you calculate with 19 instead of 2A and 18 instead of 2B. The tool does this automatically.
No. The key catches common typing errors, but an invented number can have a correct key. Only authorised bodies can confirm that a number was issued to a person.
No. The NIR uses a modulo 97 check. The Luhn algorithm is used by other identifiers, such as the SIREN number of French companies or bank card numbers.
No. The calculation runs in your browser: the number is not stored, transmitted or recorded by our analytics. In France, the use of the NIR is strictly regulated, as the CNIL points out.
When the month of birth is unknown, INSEE uses special codes instead of 01 to 12. The key is calculated in the same way.
Related tools
Tools similar or complementary to this one.
Build a French intra-community VAT number from a SIREN or SIRET, or check its key.
Estimate net pay before income tax from gross salary, or calculate gross pay from net.
Calculate pay from hours worked × hourly rate or convert hourly, weekly, monthly and annual salary.
Understand how to estimate net-before-income-tax pay from gross salary, reverse the calculation and why no single rate fits every situation.
Learn how to calculate a salary raise, find the percentage between two salaries and measure the monthly or annual increase.
Learn how income, existing debts, down payment, interest rate and loan term shape mortgage affordability and your realistic home-buying budget.
Learn how to convert hourly pay to monthly or annual salary, find an hourly rate and understand the 151.67-hour monthly basis.