Codice Fiscale Calculator
Codice Fiscale
Calculate your Italian codice fiscale online, free — including births abroad and homocody variants
🔒 Privacy: the data you enter is never saved or sent to our servers: the calculation runs entirely in your browser.
Enter a surname, first name, sex, date of birth and place of birth, and this calculator builds the 16-character codice fiscale exactly as the official Italian algorithm does. It works for births in any Italian municipality and for births abroad, and it can also list every homocody variant of the code it produces: the alternative versions used when two people would otherwise share one code. The result can be copied, shared or printed as a card.
One limit is worth knowing before you start: a calculated code is an accurate prediction, not an official assignment. The only codice fiscale with legal value is the one issued and registered by the Agenzia delle Entrate (Italian Revenue Agency) in the Anagrafe Tributaria, the national tax registry. Use the result to check paperwork or to see in advance what your official code will look like.
How the 16 characters are built
A codice fiscale is not a random serial number. It is a compressed summary of your identity data, assembled by fixed rules, so anyone who applies the same rules to the same data arrives at the same code. The first six characters come from your name. Three are taken from the surname and three from the first name, using the consonants in order; if a name has too few consonants, its vowels are used, and if it is still too short the letter X fills the gap.
The date of birth supplies the next five characters. Two digits give the year, so 1980 becomes 80. A single letter gives the month, from a fixed table in which January is A, February is B, March is C, April is D, May is E, June is H, July is L, August is M, September is P, October is R, November is S and December is T. Two digits give the day, with one twist: for women, 40 is added to the day, so a woman born on the 7th carries 47, and the day value alone reveals the holder’s sex.
| Positions | What they hold | How they are formed |
|---|---|---|
| 1 to 3 | Surname letters | Consonants of the surname, then vowels, then X |
| 4 to 6 | First name letters | Consonants of the first name, then vowels, then X |
| 7 to 8 | Year of birth | Last two digits of the year |
| 9 | Month of birth | One letter from the official month table |
| 10 to 11 | Day of birth | 01 to 31, plus 40 for women (41 to 71) |
| 12 to 15 | Place of birth | Belfiore code of the municipality, or a Z code for a foreign country |
| 16 | Check letter | Computed from the first 15 characters |
The last character, the check letter, is calculated from the fifteen before it. Each character is converted into a number using one table for characters in odd positions and another for characters in even positions; the numbers are added together, the total is divided by 26, and the remainder selects a letter from A to Z. This letter adds no information about you: its purpose is error detection, because changing any character of a code makes the check letter stop matching.
Homocody: when two people get the same code
Compression has a price. Because the code keeps only a few letters of each name and two digits of the birth year, two different people can produce exactly the same sixteen characters: think of two men with similar names, born on the same day in the same town. This collision is called homocody, omocodia in Italian, and it is the main reason a calculated code can differ from an official one.
When a collision occurs, the Agenzia delle Entrate does not change anyone’s data. Instead it issues a variant of the base code in which digits in up to seven defined positions are replaced by letters. Seven substitutable positions produce 127 possible variants, and the calculator above can list all of them for any code it generates.
Only the Agenzia can say which variant is officially yours, because only its registry records which variants have already been handed out. So if your official card shows a letter where this calculator shows a digit, homocody is the likely explanation, and the official document wins.
Born abroad? Z codes
The four place characters work differently when the birth took place outside Italy. Instead of the Belfiore code of an Italian municipality, the code carries the letter Z followed by three digits that identify the foreign country: the United States is Z404 and Germany is Z112, for example. These Z codes are assigned by the Agenzia delle Entrate and are the same for everyone born in that country.
This applies both to foreign citizens and to Italian citizens born abroad, because what matters is the place of birth, never the place of residence. In the calculator, select Abroad and choose the country from the list. If you were born in Italy instead, select In Italy and choose the municipality; our Belfiore codes page explains how the municipal codes behind that list work.
How to get the official code
When you need the official code itself rather than a prediction, the application goes to the Agenzia delle Entrate. In Italy you can apply at one of its offices, and residents can also use its online services by logging in with SPID or CIE credentials. When the code is assigned during registration with the Italian health service, the ASL (local health authority) is the office involved.
From abroad, Italian consulates issue the code to people who apply in their country of residence, and newborns receive theirs through the municipality and Agenzia process that follows the registration of the birth. If you are a foreigner planning a move, work or study in Italy, every route is explained step by step in our codice fiscale for foreigners guide; if you are buying a home from abroad, see also the guide for foreign property buyers.
Frequently asked questions
Is the code from this calculator official?
No. The calculator reproduces the official algorithm faithfully, so its result matches the official code in most cases, but only the Agenzia delle Entrate issues and registers the official code. Treat the result as an accurate prediction, and always follow the official document if the two ever differ.
Why does my calculated code differ from the code on my card?
The most common reason is homocody: the Agenzia delle Entrate replaced one or more digits with letters because another person shared your base code. A difference in how your name was registered, or selecting the modern municipality instead of the historical one you were born in, can also shift the result. The code on your official card or certificate is the correct one to use.
What happens if two people generate the same code?
One person keeps the base code; the other receives a homocody variant, with letters substituted for digits at up to seven positions (127 variants in total). Because the Agenzia’s registry alone records which variants are already assigned, only the Agenzia can confirm which variant belongs to which person.
Can I calculate a codice fiscale for a newborn?
Yes, as a prediction, using the baby’s surname, first name, sex, date and place of birth. The official code for a newborn is assigned through the municipality and Agenzia delle Entrate process after the birth is registered, and it normally matches the calculated result.
Does my codice fiscale change if I move to a new address?
No. The code is built from your name, your date of birth and your place of birth, and none of those change when you move. Residence never appears in the code, so moving house, even abroad, leaves it untouched.
What is the check letter at the end of the code?
It is a control character computed from the first fifteen characters: odd and even positions are converted to numbers, the numbers are summed, and the remainder after division by 26 selects the letter. Its job is to catch typing mistakes: a code whose check letter does not match is certainly mistyped or invalid.
How can I calculate my Italian codice fiscale from my personal data?
Enter your surname, name, sex, date and place of birth in the calculator on this page: it builds the 16-character code from your personal data — letters taken from your surname and name, your birth date and sex, the Belfiore code of your birthplace, and a final check character. The result follows the official calculation rules, but the official code is only ever assigned by the Agenzia delle Entrate.
Keep exploring
Once you have a code, you can check a codice fiscale for formal validity, decode an existing one with the reverse lookup, or look up any town in the Belfiore codes list. For the complete picture, start from our English guide to the codice fiscale.