How the codice fiscale is built, character by character
Every resident of Italy, and many people who only rent a flat or open a bank account there, needs a codice fiscale. It looks random, but it is built from your personal details with fixed rules set by an Italian ministerial decree of 23 December 1976. Once you know the rules you can read a code at a glance and spot a typo on a form. Here is the whole recipe, with examples worked out by the same engine as our codice fiscale calculator.
The seven parts
Take Emma Louise Johnson, born in the United Kingdom on 17 August 1991. Her code is JHNMLS91M57Z114X:
| Characters | Meaning | Emma’s code |
|---|---|---|
| 1–3 | surname | JHN |
| 4–6 | first name(s) | MLS |
| 7–8 | year of birth | 91 |
| 9 | month of birth | M |
| 10–11 | day of birth and sex | 57 |
| 12–15 | place of birth | Z114 |
| 16 | check letter | X |
Surname: three letters
Write the consonants of the surname in order and keep the first three. If there are fewer than three, add the vowels in order; if it is still short, fill with X. Spaces, apostrophes and accents are ignored. Johnson gives JHN, Müller gives MLL, Li gives LIX.
First name: three letters, with a twist
Same rule, except when the name has four or more consonants: then you take the 1st, 3rd and 4th, skipping the 2nd. “Emma Louise” is written as EMMALOUISE; its consonants are M M L S, four of them, so the result is MLS. Without the middle name, “Emma” alone would give MME. This is the most common reason a calculated code does not match a real one: a middle name that was, or was not, recorded.
Year, month and day
The year keeps its last two digits. The month is a letter:
| Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec |
|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | H | L | M | P | R | S | T |
The day is two digits. For men it is just the day; for women 40 is added. Emma, born on the 17th, has 57. So the code shows the sex without a separate character: 01–31 is male, 41–71 female.
Place of birth
For people born in Italy, characters 12–15 are the codice catastale of the comune where they were born: Rome is H501, Milan F205. For people born abroad it is a code for the country, always starting with Z: United Kingdom Z114, Germany Z112, United States Z404. Hans Müller, born in Germany on 4 December 1979, has MLLHNS79T04Z112C.
What counts is your country of birth, not your nationality. The list on this site has 239 country codes, including countries that no longer exist such as Netherlands Antilles (Z501), Czechoslovakia (Z105), Germany Est (Z111).
The check letter
The 16th character is computed from the first 15. Each character is turned into a number: characters in odd positions (1st, 3rd, … 15th) use a special table, characters in even positions use their plain value (A or 0 = 0, B or 1 = 1, … Z = 25). The 15 numbers are added and divided by 26; the remainder picks the letter (0 = A, 25 = Z). For Emma the result is X. The odd-position table and a full worked example are in our Italian guide to the algorithm.
The point of the check letter is to catch mistakes: change any single character and the letter no longer matches. That is what our codice fiscale checker uses.
When digits become letters
If two people would end up with the same code, the Agenzia delle Entrate replaces some digits with letters, starting from the right: 0→L, 1→M, 2→N, 3→P, 4→Q, 5→R, 6→S, 7→T, 8→U, 9→V. This is called omocodia. Such codes are perfectly valid, and the reverse codice fiscale tool decodes them.
Your calculated code is not automatically your code
The rules give a “theoretical” code. Your real code is the one recorded by the Agenzia delle Entrate, printed on your certificate or health card. It can differ because of omocodia or because your names were recorded differently. You can check whether a code exists with the Agenzia’s verification service.
Questions
Why does my code start with letters that are not my initials?
The first six letters come from consonants of your surname and first name, not from initials. Johnson gives JHN.
Does a hyphen or apostrophe in my name matter?
No. Only letters count; hyphens, spaces and apostrophes are ignored.
Can the check character be a digit?
No, it is always a letter from A to Z.