---
title: "How to Get a Codice Fiscale in Italy as a Foreigner"
url: https://newcomersavings.com/italy/codice-fiscale/
author: Edward A
published: 2026-12-04
updated: 2026-12-04
lang: en-IT
description: "How to get a codice fiscale in 2026: automatically with your permit, at an Agenzia delle Entrate office or a consulate, what to bring, and the card you get."
---

First Steps · Updated December 2026 · By [Edward A](https://newcomersavings.com/about/#author) · 9 min read

# How to Get a Codice Fiscale in Italy as a Foreigner

Here is how to get a codice fiscale, Italy's 16-character tax code. If you are a non-EU citizen applying for a residence permit, you usually get it automatically from the Questura or the Sportello Unico per l'Immigrazione. Everyone else, including EU citizens, applies at an Agenzia delle Entrate (Revenue Agency) office with form AA4/8 and a passport, by appointment. If you live abroad, you can ask the Italian consulate in your country before you move.

Quick answer

What: 16 letters and numbers that identify you to public bodies; it never expires

Non-EU with a permit: Usually assigned by the Questura or Sportello Unico

Others in Italy: Agenzia delle Entrate office, form AA4/8, book an appointment

Before you move: Italian consulate in your country of residence

Cost: No fee is listed by the Agenzia delle Entrate

Proof: A paper certificate first, then a card by post

In this guide

1. [What is a codice fiscale and why do you need it?](#what-is-it)
2. [How to get a codice fiscale: which route is yours?](#which-route)
3. [Getting it automatically with your residence permit](#automatic)
4. [How to apply at an Agenzia delle Entrate office](#office)
5. [Can you get a codice fiscale before you arrive?](#from-abroad)
6. [Certificate, tesserino or tessera sanitaria?](#certificate-card)
7. [Next step: registering your residenza](#residenza)
8. [The carta d'identità and SPID](#carta-identita)
9. [Frequently asked questions](#faq)

## What is a codice fiscale and why do you need it?

The _codice fiscale_ (tax code) is a 16-character code made from your surname, first name, date and place of birth and sex. The Agenzia delle Entrate says it identifies you "in all dealings with public bodies and administrations". It does not expire.

In practice almost everything in Italy asks for it: a job contract and payslip, a rental contract, a bank account, a phone contract, registering with the health service (SSN) and choosing a doctor, school enrolment, and many online purchases.

**Watch out:** The only valid codice fiscale is the one issued by the Agenzia delle Entrate. Websites and apps can "calculate" a code from your details, but the Agenzia warns that these have no value and can cause problems. If two people share the same details, the official code can differ from the calculated one.

## How to get a codice fiscale: which route is yours?

| Your situation                                            | Where you get it                                       | What you bring                                                   |
| --------------------------------------------------------- | ------------------------------------------------------ | ---------------------------------------------------------------- |
| Non-EU, entering for employment or family reunification   | Sportello Unico per l'Immigrazione (at the Prefettura) | Your nulla osta paperwork and passport                           |
| Non-EU, applying for or renewing another residence permit | The Questura, during the permit process                | Your permit application documents                                |
| Non-EU, legally in Italy but still without a code         | Any Agenzia delle Entrate office, by appointment       | Form AA4/8, passport with visa or permit, proof of right to stay |
| EU citizen                                                | Any Agenzia delle Entrate office, by appointment       | Form AA4/8, passport or ID card                                  |
| Living abroad (any nationality)                           | Italian consulate in your country of residence         | Consulate's form, copy of ID, reason for the request             |

## Getting it automatically with your residence permit

Most non-EU newcomers never fill in a separate form. According to the Agenzia delle Entrate:

* If you enter Italy for **employment or family reunification**, the Sportello Unico per l'Immigrazione gives you a code. This is a temporary number-only code; you get the final code (letters and numbers) when your permit is issued.
* If you apply for **any other permit**, or renew one, the Questura assigns the code.

The code is printed on your permesso di soggiorno card. If two people's details produce the same code, the Questura or Sportello Unico gives you a temporary one and asks you to visit an Agenzia delle Entrate office for the final code. See [the permesso di soggiorno guide](https://newcomersavings.com/italy/permesso-di-soggiorno/) for the full permit process.

**Tip:** Students staying more than 90 days get their code with the permit. The Italian Ministry of Foreign Affairs says students staying less than 90 days can ask any Agenzia delle Entrate office.

## How to apply at an Agenzia delle Entrate office

1. **Download form AA4/8.** The form and instructions are free on the Agenzia delle Entrate website. Fill in your personal details and your tax address (where the card will be posted).
2. **Book an appointment.** Use "Prenota appuntamento" on agenziaentrate.gov.it or call 800 90 96 96\. The Agenzia's English page says first-time foreign applicants, EU and non-EU, must go to the counter in person so their identity can be checked.
3. **Bring your documents.** EU citizens: a valid passport or ID card. Non-EU citizens: one of these: a valid passport with visa (if you need one) or another document accepted by Italy; an identity certificate with photo from your country's embassy or consulate in Italy; a valid permesso di soggiorno; or an Italian ID card from your comune. Non-EU citizens must also show they have the right to stay in Italy, even temporarily.
4. **Get your certificate.** Once the code is assigned you receive a _certificato di attribuzione del codice fiscale_ (certificate of assignment). You can use it straight away.
5. **Wait for the card by post.** It is sent to the address you gave.

The Agenzia's Italian page also mentions sending form AA4/8 by certified email (PEC), with a copy of ID for Italian and EU citizens. As a newcomer you may not have PEC yet, and the English page asks first-time foreign applicants to attend in person, so plan for an appointment.

**Money saver:** The Agenzia delle Entrate lists no fee for assigning a codice fiscale, and the form is free. You do not need an agency to get one.

## Can you get a codice fiscale before you arrive?

Yes. The Agenzia delle Entrate says people living outside Italy can ask the Italian consular office in their country of residence. You usually fill in a form, attach a copy of your ID and say why you need the code, for example to sign a rental contract, buy property or open an account before you move.

Each consulate has its own procedure and some only accept people living in their district, so check your consulate's website. Another option is to give someone in Italy a special power of attorney to apply for you at an Agenzia delle Entrate office.

If you are coming on a work or family visa, you may not need to bother: the Sportello Unico or the Questura gives you a code when you arrive.

## Certificate, tesserino or tessera sanitaria?

Three documents can show your codice fiscale. They all carry the same code.

| Document                                               | Who gets it                              | When                                       |
| ------------------------------------------------------ | ---------------------------------------- | ------------------------------------------ |
| _Certificato di attribuzione_ (paper certificate)      | Anyone who has just been assigned a code | Straight away; use it until a card arrives |
| _Tesserino del codice fiscale_ (plastic tax code card) | People **not** registered with the SSN   | By post                                    |
| _Tessera sanitaria_ (health card)                      | People registered with the SSN           | By post after you register at your ASL     |

The _tessera sanitaria_ is free. You show it at the doctor's, at the pharmacy and when you book tests. It also works as a European Health Insurance Card in other EU countries. For foreigners it is normally valid for as long as your permit; when you renew your permit, go back to the ASL to renew your health registration and get a new card. Once activated, it can also be used as a _Carta Nazionale dei Servizi_ to log in to some public websites. See [healthcare in Italy](https://newcomersavings.com/italy/healthcare-italy/).

**Tip:** Lost your card? You can ask for a duplicate online or at an Agenzia delle Entrate office. A copy of your valid tessera sanitaria can also be printed from the Sistema Tessera Sanitaria website.

## Next step: registering your residenza

Your codice fiscale is not the same as being resident. _Residenza_ means being entered in the population register (_anagrafe_) of the comune where you live. Many things depend on it, including your identity card from the comune, local services and benefits and, later, long-term residence.

* **Deadline:** declare your new address within 20 days of moving in (Decree-Law 5/2012, article 5).
* **How:** at the comune's _ufficio anagrafe_ (registry office), or by the electronic methods your comune accepts. Bring your passport, codice fiscale and your rental contract or a declaration from your host. Non-EU citizens also bring their permesso di soggiorno or, for a first permit, the post office receipt; check your comune's list.
* **Speed:** the registrar records you within 2 working days, effective from the date you declared. The local police may visit to check you live there. If the comune does not tell you within 45 days that something is missing, your declaration is treated as accepted.
* **EU citizens** staying more than three months register with proof of work, or of enough money plus health insurance, or of studies plus insurance (Legislative Decree 30/2007).

Booking systems and document lists vary from comune to comune, so check your comune's website. If you move again, declare the new address within 20 days. Your lease matters here: see [renting in Italy](https://newcomersavings.com/italy/renting-in-italy/).

## The carta d'identità and SPID

Once you are resident, you can ask your comune for the electronic identity card (_carta d'identità elettronica_, CIE). The Ministry of the Interior says it costs **€16.79 plus the comune's fixed and administrative fees** where charged (as of December 2026). For a first card you show another valid ID document. For non-Italians, it is an identity document inside Italy; it does not replace your passport or your permesso di soggiorno.

The CIE matters because of **SPID**, the digital identity used for most Italian public websites. The official SPID site says you need a valid **Italian** identity document (ID card, driving licence or passport) plus your codice fiscale or tessera sanitaria. It also says plainly that you **cannot request SPID with a permesso di soggiorno**, but the permit lets you get the carta d'identità you need. Using SPID is free; some providers charge for certain identity checks.

## Frequently asked questions

How long does it take to get a codice fiscale?

Once the office assigns your code, you get the paper certificate of assignment, which you can use straight away. The plastic card follows by post. Book your appointment early, as slots depend on the office.

Is the codice fiscale free?

The Agenzia delle Entrate lists no fee for assigning one, and form AA4/8 is free to download. Be wary of anyone charging to "get" a code for you.

Can I get a codice fiscale online?

Only partly. The Agenzia's Italian page mentions sending form AA4/8 by PEC, but its English page says first-time foreign applicants must go in person. From abroad, use the Italian consulate.

Does my codice fiscale change when I get a permit?

Normally no; it is for life. A temporary number-only code from the Sportello Unico is replaced by the final code when your permit is issued.

Is the tessera sanitaria the same as the codice fiscale?

No, but it shows your codice fiscale. You get the tessera sanitaria only if you register with the national health service; otherwise you get the plain tax code card.

Can I use a codice fiscale generated online?

No. Only the code issued by the Agenzia delle Entrate is valid.

Keep reading

* [Moving to Italy checklist: your first 30 days](https://newcomersavings.com/italy/moving-to-italy-checklist/)
* [Permesso di soggiorno: how to apply and what it costs](https://newcomersavings.com/italy/permesso-di-soggiorno/)
* [How to open a bank account in Italy](https://newcomersavings.com/italy/open-bank-account-italy/)

Sources

1. [The codice fiscale: what it is and how to get it (Agenzia delle Entrate)](https://www.agenziaentrate.gov.it/portale/codice-fiscale-e-tessera-sanitaria/che-cos-cittadini)
2. [Tax identification number for foreign citizens (Agenzia delle Entrate, English)](https://www.agenziaentrate.gov.it/portale/web/english/nse/individuals/tax-identification-number-for-foreign-citizens)
3. [Codice fiscale for foreign citizens leaflet (Agenzia delle Entrate)](https://www.agenziaentrate.gov.it/portale/documents/20143/233505/Folder%5FCodiceFiscaleStranieri%5F08+03+23.pdf/218dc638-ced1-3b2d-f5f2-912686b1f7fe)
4. [The tessera sanitaria: what it is and how to get it (Agenzia delle Entrate)](https://www.agenziaentrate.gov.it/portale/codice-fiscale-e-tessera-sanitaria/la-tessera-sanitaria-che-cos-e-e-come-si-ottiene-cittadini)
5. [Codice fiscale for foreign citizens not resident in Italy (Italian Embassy, Ministry of Foreign Affairs)](https://ambvilnius.esteri.it/wp-content/uploads/2026/02/Codice-Fiscale.pdf)
6. [Decree-Law 5/2012, article 5: change of residence in real time (Normattiva)](https://www.normattiva.it/uri-res/N2Ls?urn:nir:stato:decreto.legge:2012-02-09;5~art5)
7. [Legislative Decree 30/2007, article 9: EU citizens' registration (Normattiva)](https://www.normattiva.it/uri-res/N2Ls?urn:nir:stato:decreto.legislativo:2007-02-06;30~art9)
8. [Electronic identity card: issue and renewal in Italy (Ministry of the Interior)](https://www.cartaidentita.interno.gov.it/richiedi/rilascio-e-rinnovo-in-italia/)
9. [How to activate SPID (SPID official site)](https://www.spid.gov.it/en/what-is-spid/how-to-activate-spid/)

This guide is general information for newcomers and is not legal, tax, financial or immigration advice. Rules and amounts change, so always confirm with the official source linked above. Last reviewed December 2026.
