Skip to main content
0/16
The fiscal code is processed on premises and not saved to any external servers.
Powered by Llama 3.1 via Ollama. May take a few seconds to load.

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: real day (1-31) Female: day of the month plus forty (42-72)
  6. Municipality (positions 12-15) Birth Code of the place of birth (e.g., H501 = Rome)
  7. Checksum position: 16) Weighted sum of the first 15 characters, even/odd tables -> remainder modulo 25 -> 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 an on-prem text summary without sending data to third-party cloud services.

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, the code is sent to the backend, which then sends it to the Ollama model installed on-prem on your VPS, without persistence or external cloud services.

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.