Italy Codice Fiscale Generator
Generate and format valid Italian Codice Fiscale (Tax Code) numbers for QA and development.
Waiting for generation...
About Italy Codice Fiscale
The Codice Fiscale is the personal tax identification number assigned to citizens and residents in Italy by the Agenzia delle Entrate (DPR 605/1973 and DM 23/12/1976).
It consists of 16 alphanumeric characters (LLLLLLNNLNNLNNNL) encoding surname (3 letters), first name (3 letters), birth year (2 digits), birth month (1 letter A-T), day and gender (+40 for females), cadastral municipality code (Belfiore), and a check character (CIN) computed via Modulo 26.
Anatomy & Structure of Italian Codice Fiscale (16 Characters)
The Italian Fiscal Code comprises 16 alphanumeric characters distributed across 6 functional blocks:
| Position | Field | Length | Meaning & Rule | Example |
|---|---|---|---|---|
| 1 to 3 | Surname (Cognome) | 3 letters | First 3 consonants of family surname | RSS |
| 4 to 6 | First Name (Nome) | 3 letters | 1st, 3rd and 4th consonants of first name (or first ones if < 4) | MRA |
| 7 & 8 | Birth Year | 2 digits | Last 2 digits of the birth year | 85 |
| 9 | Birth Month | 1 letter | Alphabetic month code (A to T, skipping non-standard letters) | M |
| 10 & 11 | Day & Gender | 2 digits | Day of birth: 01-31 for males; 41-71 for females (+40) | 01 |
| 12 to 15 | Cadastral Code (Belfiore) | 4 chars | Belfiore code identifying birth municipality or foreign country | H501 |
| 16 | Control Character (CIN) | 1 letter | Checksum letter derived via Modulo 26 with odd/even weight tables | Q |
Codice Fiscale Validation Algorithm (Modulo 26 CIN)
The Agenzia delle Entrate determines the CIN character via separate odd and even character weights:
CIN = char(65 + (sum(odd_weight(c_i)) + sum(even_weight(c_j))) % 26)
- 1. Extract the first 15 characters of the code (0-indexed 0 to 14).
- 2. For characters at odd positions (1st, 3rd, 5th... index 0, 2, 4...), map using the official odd weights table.
- 3. For characters at even positions (2nd, 4th, 6th... index 1, 3, 5...), map using the official even weights table.
- 4. Sum all mapped weight values.
- 5. Compute the remainder modulo 26: Remainder = Total % 26.
- 6. The 16th character must match the letter corresponding to the remainder (0=A, 1=B, ..., 25=Z).