Italian fiscal code

The Italian fiscal code, officially known in Italy as Codice fiscale, is the tax code in Italy, similar to a Social Security Number (SSN) in the United States or the National Insurance Number issued in the United Kingdom. It is an alphanumeric code of 16 characters. The code serves to unambiguously identify individuals irrespective of citizenship or residency status. Designed by and for the Italian tax office, it is now used for several other purposes, e.g. uniquely identifying individuals in the health system, or natural persons who act as parties in private contracts. The code is issued by the Italian tax office, the Agenzia delle Entrate.

What is the Italian fiscal code need for? among others 1. opening a bank account in Italy 2. signing a rental lease for an Italian property 3. registering at Italian sanitary system 4. incorporating a company in Italy and for many others needs when relocating (also temporarily) to Italy.

In the past, each person in Italy was handed a paper or plastic card with a magnetic strip, bearing the tax code as well as the surname, given name(s), sex, place and province of birth (or country of birth if foreign), date of birth and date of issue. Today, the fiscal code card has been replaced by a combined Italian health insurance card for qualifying residents which shows an expiration date.

Fiscal code generation
The laws covering the calculation of a fiscal code were put in place by the Ministry of Economy and Finances on December 23, 1976.

For natural persons, the fiscal code is made of 16 alphanumeric characters; for legal persons (e.g. corporations) it comprises 11 numeric-only characters. While it is possible to calculate one's tax code, the only official tax code is the one provided by the tax office, which avoids cases of identical tax codes (which is a frequent case for people not born in Italy, as in this case the 4-characters town code in the codice fiscale is replaced by "Z" followed by a 3-digit country code) as well as cases where a code is incorrect, but still valid (because provided by the tax office).

The algorithm that follows is used to generate natural persons' fiscal codes.


 * Surname (3 letters): the first three consonants of the surname are used. If there is more than one surname, both are considered as if they were one. If the surname has less than three consonants, then vowels will replace the blank spaces, in the same order they appear in the surname (e.g. "Rossi" would be RSS, "Masi" would be MSA). If the whole surname has less than three letters, the blank spaces are replaced with an X (e.g. "Fo" would be FOX, "Hu" would be HUX). The surname used is always the name that appears in the person's primary identification document: for native Italians, this is the carta d'identità (identity card).


 * It is important to note that in Italy women do not 'officially' change their surnames when they marry: therefore, a woman does not require a new fiscal code (or identity card, or passport) if she already has one at the time of her marriage. However, when a woman obtains a fiscal code after she is married (generally, this applies only to foreigners born outside Italy) then the surname that appears in her primary identification document (usually, her passport) must be used to produce the fiscal code: in many cases, this will be the surname of her husband.


 * First name (3 letters): the first three consonants of the name are used. If there is more than one name, both are considered as if they were one. If the name has less than three consonants, then vowels will replace the blank spaces, in the same order they appear in the name (e.g. "Marco" would be MRC, "Paola" would be PLA). If the whole name has less than three letters, the blank spaces are filled with an X (e.g. Chinese name "Na" would be NAX). Some indian immigrants in Italy are registered with a triple X instead of their first name, since their passport only indicates a single word which is used as a surname by the Italian register office. If the name has more than three consonants, the 2nd is skipped (e.g. "Riccardo" would be RCR; "Martina" would be MTN). This second-consonant skipping rule for names that have more than three consonants is only used for first names, not for surnames.


 * Birthdate and gender (5 alphanumeric characters)
 * Year of birth (two digits): the last two year of birth digits are used (e.g. "1972" would be 72);
 * Month of birth (one letter): each single month is associated with one letter, as shown in the table:


 * Birthday and gender (2 digits): the two birthday digits are used (from 01 to 31); if the person is a woman, 40 is added (e.g. 01 would be 41, 31 would be 71).


 * Town of birth (4 alphanumeric characters)
 * The so-called Belfiore code is used as codice catastale (registry code), which comprises one letter, then three digits. Each single Italian town (comune) has its own code, which is mostly determined by alphabetical order (e.g. Abano Terme in the province of Padua, the 1st Italian comune in alphabetical order, has the code A001). People born in a foreign country have their own code according to the country of birth, all of them beginning with letter Z (e.g. United States code is Z404, the UK code is Z114, Australia is Z700, etc.). For the complete list of the Italian towns' registry codes, see here; for the complete list of foreign countries' registry codes see here.


 * Check character (one letter)
 * Starting from the preceding 15 characters, a check digit is determined as follows:
 * the eight odd characters (1st, 3rd, 5th, etc.) are set apart; same thing for the seven even ones (2nd, 4th, 6th, etc.).
 * after that, each single character is converted into a numeric value as shown in the tables below:


 * after that, all of the values are to be added up, and the final result has to be divided by 26; the remainder (Modulo) will give the last character, according to the following table:


 * Should two people yield the same code, the fiscal administration replaces some of the numeric digits (starting from the rightmost one) with letters, based on this table:


 * After such replacement is applied, the check digit is to be recalculated.

Examples
Here is the fiscal code of a fictitious Matteo Moretti (male), born in Milan on 8 April 1991:
 * Surname: MRT
 * Name: MTT
 * Birthdate and gender: 91D08
 * Place of birth: F205
 * Check digit: J
 * Fiscal code: MRTMTT91D08F205J

Here is the fiscal code of a fictitious Samantha Miller (female), born in the USA on 25 September 1982, living in Italy:
 * Surname: MLL
 * Name: SNT
 * Birthdate and gender: 82P65
 * Place of birth: Z404
 * Check digit: U
 * Fiscal code: MLLSNT82P65Z404U