French NIR Generator

Generator

Generate a valid French NIR social security number for testing. Computes the official 2-digit control key, including the Corsica 2A/2B department substitution. For testing purposes only.

Generator Options
Generated NIR
Click "Generate NIR" to create a test number
Sponsored

Travel insurance built for nomads

Comprehensive medical and travel coverage wherever you go. No long-term commitment required.

Coverage in 185+ countries
Cancel or pause anytime
Home country coverage included

Testing a French business too?

This tool generates a French individual NIR (social security number). For a French business number, use our SIRET/SIREN Generator →

About this tool

About French NIR Generator

The NIR (Numéro d'Inscription au Répertoire), printed on every Carte Vitale, is France's social security number: sex + year + month + department (2 digits, or 2A/2B for Corsica) + commune + order number + a 2-digit control key. The key is 97 minus the remainder of the first 13 digits divided by 97 — with Corsican departments 2A and 2B substituted to 19 and 18 respectively before that division, per INSEE's rule.

This generator lets you pick a sex, or generate a random Corsica (2A/2B) number specifically to exercise that substitution rule, then computes the correct 13-digit body and control key using BigInt arithmetic (the 13-digit number exceeds what standard JavaScript number multiplication can safely handle). A curated table of French department codes and names is included for reference.

Ideal for testing French HR, payroll, health-insurance, and government-facing onboarding systems that collect a NIR, including edge cases for people born in Corsica, without using a real person's social security number.

Every generated NIR has a mathematically correct control key, verified against INSEE's documented formula and Corsica substitution rule. All generation happens locally in your browser.

Key Features

  • Official 97 − (mod 97) control key formula
  • Correct Corsica 2A→19 / 2B→18 substitution before the modulo operation
  • BigInt arithmetic for the 13-digit calculation
  • Choose sex, or specifically generate a Corsica example
  • Segmented breakdown of every field
  • 100% browser-based, no data sent
  • For testing purposes only

FAQ

French NIR Generator — Frequently Asked Questions

How is the NIR control key calculated?

Take the first 13 characters (sex, year, month, department, commune, order), convert to an integer, divide by 97, and subtract the remainder from 97. The result is the 2-digit control key. Because this 13-digit number is too large for standard JavaScript arithmetic to handle safely, this tool uses BigInt.

Why does Corsica need special handling?

Corsican departments are written as 2A (Corse-du-Sud) and 2B (Haute-Corse) rather than plain numbers, but the control-key formula needs a pure integer. Before dividing, 2A is replaced with 19 and 2B with 18 — this substitution rule is specific to the NIR calculation and does not appear anywhere else on the document.

Is this a real social security number?

No. All fields — sex, year, month, department, commune, and order number — are randomly chosen (or set by you), and the key is computed correctly for whatever combination results. The number is not assigned to any real person by INSEE or the French social security administration.

Can I generate a NIR for a specific department?

Yes — pick any department from the dropdown, including the two Corsican codes (2A, 2B), and the generator will compute a correctly-keyed NIR for it.

Tips

  • Use the Corsica option specifically to test the 2A/2B edge case in your own validation code
  • The NIR does not encode a full 4-digit birth year — only the last two digits are stored, so the century is ambiguous by design
  • Pair a generated NIR with the SIRET/SIREN Generator if you're testing a French relocation or HR onboarding flow
  • These numbers are for testing only — they are not real social security numbers

Explore more

Related Tools

Other tools that might be useful for your workflow