1001Ferramentas
🇮🇹 Generators

Fake Italian Codice Fiscale Generator

Generate an Italian Codice Fiscale with valid checksum from name/date — for signup form testing only.

Aviso: código de comune (belfiore) é aleatório. Use apenas em testes — não vincule a pessoas reais.

Codice Fiscale: how Italy encodes your identity into 16 characters

The Codice Fiscale ("CF") is Italy's national tax identification number, issued by the Agenzia delle Entrate. Unlike opaque identifiers such as the Brazilian CPF or the Dutch BSN, the Codice Fiscale is transparent: anyone who knows the algorithm can read the holder's surname initials, first name initials, year, month and day of birth, gender and place of birth straight from the 16-character string. This makes the CF unusually useful as a database key (it is self-validating against a person's basic data) and unusually problematic from a privacy standpoint.

A typical example: RSSMRA85M01H501Z decodes as Mario Rossi, male, born 1 March 1985 in Rome (Belfiore code H501), check character Z.

Structure of the 16 characters

RSS  MRA  85  M  01  H501  Z
 |    |   |   |  |   |     |
 |    |   |   |  |   |     +- check digit (0-9, A-Z)
 |    |   |   |  |   +------- comune of birth (Belfiore code)
 |    |   |   |  +----------- day of birth (+40 if female)
 |    |   |   +-------------- month code (A=Jan, B=Feb, ..., T=Dec)
 |    |   +------------------ last two digits of birth year
 |    +---------------------- 3 letters from given name
 +--------------------------- 3 letters from surname
  • Surname (3 chars): first three consonants in order; if fewer than three, fill with vowels; if still short, pad with X.
  • Given name (3 chars): if four or more consonants, take the 1st, 3rd and 4th; otherwise same rule as surname.
  • Month coding: A=Jan, B=Feb, C=Mar, D=Apr, E=May, H=Jun, L=Jul, M=Aug, P=Sep, R=Oct, S=Nov, T=Dec.
  • Day +40 for female: a woman born on the 1st gets day 41; this is the only direct gender marker.
  • Comune code: 4 chars from the Belfiore registry (H501 = Roma, F205 = Milano, L736 = Napoli). For births abroad, a Z prefix plus country code (Z110 = Brazil).
  • Check character: alphanumeric, computed via an odd/even position table defined by Ministerial Decree of 23 December 1976.

Use cases and the SPID

The CF is required for: tax filing (Dichiarazione dei Redditi), opening a bank account, signing rental contracts, registering with the Servizio Sanitario Nazionale (national health service), employment, school enrolment and university registration. It is also the linchpin of SPID, Italy's federated digital identity scheme, and is exchanged between EU tax authorities under DAC2 as Italy's flavour of TIN (Tax Identification Number).

Foreigners working, studying or owning property in Italy receive a temporary CF computed from their passport data. With 30+ million people of Italian descent in Brazil — many of whom apply for cittadinanza italiana iure sanguinis through Consolato Generale d'Italia — the CF is a routine requirement during the application process.

Homocodia: when two people get the same Codice Fiscale

Because the CF is derived from a small amount of personal data, collisions are mathematically possible — two people born on the same day in the same place with similar names. This is called omocodia. Italian law (DPR 605/1973) defines a deterministic patch: specific digits are replaced with letters according to a fixed table, starting from the rightmost numeric position. Each patch produces a new check digit. Most omocodia are resolved with a single substitution, but the algorithm scales up to seven substitutions for extreme cases.

Difference from CPF and use of synthetic CF

Brazilian CPF is opaque — knowing a CPF tells you nothing about the holder. Italian CF is the opposite: it leaks date of birth, gender and birthplace. This makes the CF excellent for self-consistency checks but means that storing a CF in a public database arguably exposes sensitive personal data without consent. EU GDPR enforcement (Garante per la Protezione dei Dati Personali) has issued guidance limiting non-essential CF processing.

Synthetic CFs from this generator are useful for: unit-testing the omocodia patch logic, seeding development databases for Italian fintechs, validating CF parsers, and running integration tests against the Agenzia delle Entrate sandbox APIs. The Belfiore code is randomised, so they are guaranteed not to match real citizens.

Frequently asked questions

Can I use these CFs for tax filing? No. Generated CFs are structurally valid but not registered with the Agenzia delle Entrate. Use them only in sandboxes, unit tests and seed data.

How do I get a real CF as a Brazilian citizen? Apply at the nearest Consolato Generale d'Italia (Rio, São Paulo, Belo Horizonte, Curitiba, Porto Alegre, Recife) — or, if already in Italy, at any Agenzia delle Entrate office with your passport. Cost: free.

Does a CF reveal personal data? Yes — surname/name initials, birth date, gender and birthplace are encoded. This is why GDPR-conscious Italian sites avoid printing CF on public-facing receipts.

What if my Brazilian birth city is not in the Belfiore registry? For births abroad the code is Z + country code: Z110 for Brazil, Z103 for Argentina, Z602 for the United States. The municipality of birth does not affect the code, only the country.

How do I validate a CF in code? Reusable libraries exist: codice-fiscale-js (Node), python-codicefiscale (Python), CodiceFiscale (PHP). They all implement the same Ministerial Decree algorithm.

Related Tools