Skip to main content
0/16
Validation happens in your browser. If you ask for the AI explanation, the tax code is sent to our server: if it is valid we decode it there from a lookup table; if it is invalid we also pass it to the AI model running on our server to suggest a correction.
Runs on our server. May take a few seconds.

How does the algorithm work?

  1. Surname (positions 1-3:) Consonants ordered first then vowels and finally an "X" as padding up to three characters long.
  2. Name (positions 4-6:) If there are ≥4 consonants use the first, third and fourth ones otherwise as for surname.
  3. Year (positions 7-8) Last two digits of the year of birth (e.g., 85 → 1985 or 2085).
  4. Month (position: 9) Letter from table: G = Gen, F = Feb, M = Mar, A = Apr, J = Jun, I = Jul, O = Aug, N = Sep, D = Oct, B = Nov, C = Dec.
  5. Day + Sex (positions 10-11) Male: actual day (01-31). Female: day + 40 (41-71).
  6. Municipality (positions 12-15) Birth Code of the place of birth (e.g., H501 = Rome)
  7. Check digit (pos. 16): Weighted sum of the first 15 characters with odd/even tables → remainder mod 26 → letter.

Come utilizzare Codice Fiscale Explainer

Enter 16-character tax code

Enter or paste the tax code into the input field: it will be automatically converted to uppercase and limited to 16 characters.

Decode the code

Click on "Decode CF": validation and data extraction (name, surname, birthdate, gender, town, check digit) occur entirely in the browser, without sending anything to the server.

Verify Omocodice and Check Digit

The tool signals if the code has homophones (letters in place of digits at positions 7-13) and compares the declared check digit with the recalculated one to validate its structural authenticity.

Generate narrative AI explanation (optional)

Click to generate a text summary on our server (the code is sent to the provider).

Suggerimenti

  • Use this tool to quickly verify the consistency between a received tax code and declared personal data, for example during client onboarding.
  • If the code contains homophones, the "Normalized CF" shown only restores the original digits for internal calculation: the legal code remains always with special letters.
  • It does not need to activate AI explanation for quick use: deterministic decoding is already complete and instantaneous, the AI only adds a discursive summary.

Domande frequenti

How is the Italian tax code calculated?

Tax Agency Algorithm (DM 23 December 1976) combines 3 letters from surname, 3 from name, 2 digits of birth year, 1 letter for month, 2 digits for day and sex (+40 for females), 4 characters for the town (Belfiore code) and 1 weighted check digit calculated with a sum mod 26.

What is homophone and why do some fiscal codes use letters instead of numbers?

When more people generate the same tax code (same surname, name, birthdate and commune), the Tax Agency progressively replaces digits in positions 7-13 with special letters (L M N P Q R S T U V) to make it unique. It is a legal code at 100%.

Is my tax code being saved somewhere?

No. Validation and decoding always happen client-side in your browser. Only if you enable the AI narrative explanation is the code sent to our server: if it is valid we decode it there from a lookup table; if it is invalid we also pass it to the AI model running on our server to suggest a correction. The backend does not keep it, and it is not sent to third-party AI providers.

Why is the town not always recognized by name?

The tool uses a local Belfiore code lookup that covers common municipalities, but not the complete historical archive (including suppressed or foreign municipalities). In these cases, the 4-digit code is still shown with an indication to manually verify on the Italian Revenue Agency website.

What does it mean if the calculated check digit does not match the one entered?

Invalid code means the fiscal code is not structurally valid: it may contain typing errors, be fabricated or corrupted. Recheck the 16 characters directly from the original document (health card or ID card).

Do you want other tools for Italian developers?

Subscribe to Federico's Newsletter for updates on new tools, technical articles and guides about Italian tax law and regulations.