If you are going to live in Spain or carry out any kind of legal or financial procedure, you will need a tax identification number. Depending on your situation, that tax ID can be called NIF or CIF, which at the same time can be equal to your NIE or DNI. But enough terminology. Let’s dive deep into the article and fully understand when exactly will you need your tax ID, how to get it, and what exactly is the difference between CIF and a NIF.
Key takeaways
- NIF: the tax identification number for any operation with tax implications; Spanish citizens use their DNI number and foreigners use their NIE.
- CIF: the old name for a company’s NIF, legally called NIF since 2008; it has 9 characters and starts with a letter that shows the type of entity.
- Company NIF: the notary usually requests a provisional NIF with Form 036 when the company is incorporated; it is valid for 6 months and becomes definitive once the deed is registered.
- No DNI or NIE: the Tax Agency can assign a NIF K, L or M with Form 030, which is valid only for tax purposes and gives no right to live or work in Spain.
- VAT number: a NIF is not automatically a VAT number: for intra-EU trade you register in the ROI with Form 036 and use ES followed by your NIF.
- Tax residence: having a NIF does not make you a tax resident; that depends on criteria such as spending more than 183 days a year in Spain.
Free live webinar · Thu 3 Dec · 17:00 CET
Taxes in Spain for expats, made clear
Tax residency, income tax, the Beckham Law and Model 720, with Cristian Balcells and tax accountant Pau Pascual. 45 minutes with live Q&A, in English, online.
Who needs a tax identification number in Spain?
| Number | What it is | Who uses it |
|---|---|---|
| NIF | Tax identification number for any operation with tax implications | Everyone: individuals and companies |
| NIE | Foreigner identity number; it also works as their NIF | Foreign nationals |
| CIF | Old name for a company’s NIF (legally called NIF since 2008) | Companies and other legal entities |
| VAT number (NIF-IVA) | The NIF with the “ES” prefix, used for intra-EU operations | Businesses and freelancers registered in the ROI |
No matter your situation, if you participate in any type of economic or financial activity in Spain, you will need to request a tax identification number: to set up a company, work as a freelancer, issue invoices or buy a property, for example.
What is a CIF number in Spain?
The CIF is the tax ID number that identifies a company or legal entity in Spain. Hence, if you are to set up a company in the Spanish territory, you will need to request this extra number, as your personal tax identification is not enough. Since 2008 it is legally called NIF, but the term CIF is still widely used.
This CIF is made up of 9 characters:
- The first character is a letter that indicates the type of organization or business structure (for example, A for stock corporations, or B for limited liability company). Each type of company has its own letter.
- Next come seven digits. Since July 2008, they are random numbers.
- Finally, a control digit, which can be numerical or a letter. It is calculated with the prior characters.
Companies created before July 2008 may still have a NIF whose first two digits match their province (for example, 08 or 58 for Barcelona and 28 for Madrid), because existing numbers were not changed. In new NIFs, those digits no longer indicate where the company is registered.
Bear in mind that the CIF is not automatically a VAT number for EU trade. We explain the difference below.
Finally, it is also important to note that the CIF number, even though many still refer to it, does not legally exist since 2008 (Royal Decree 1065/2007), as it merged with the NIF. This does not mean, of course, that the procedure and requirements will differ depending on whether you are a company or an individual.
How a company gets its NIF (CIF): provisional and definitive
- Provisional NIF. While the company is being set up, a provisional NIF is requested with Form 036. The notary usually does this electronically when the company is incorporated. The provisional NIF is valid for 6 months.
- Definitive NIF. Once the deed is registered in the Mercantile Registry, the company submits it to the Tax Agency and the NIF becomes definitive. The number stays the same.
Foreign companies (NIF N or W) usually also need a certificate of good standing from their home registry, with an apostille and sworn translation, and a power of attorney for their representative in Spain.
How to know the CIF of a company
If you want to know the CIF of any company, it’s quite straightforward.
You simply need to enter this link, type the name the company, click on search, and you will instantly find its corresponding CIF.
You can also find it on the company’s invoices or in the legal notice of its website. If the company trades with other EU countries, you can check its VAT number in the EU’s VIES database.
CIF number example
Your CIF will look something like this: B12345678. As you can see, a letter, 7 digits and a control character.
In this case, the letter B corresponds to the type of entity. These are the letters used for Spanish and foreign entities:
| Letter | Type of entity |
|---|---|
| A | Public limited company (Sociedad Anónima, SA) |
| B | Limited liability company (Sociedad Limitada, SL) |
| C | General partnership (sociedad colectiva) |
| D | Limited partnership (sociedad comanditaria) |
| E | Joint ownership, undivided estates and other entities without legal personality |
| F | Cooperative |
| G | Association |
| H | Homeowners’ association (comunidad de propietarios) |
| J | Civil partnership (sociedad civil) |
| N | Foreign entity |
| P | Local authority |
| Q | Public body |
| R | Religious congregation or institution |
| S | State or regional government body |
| U | Temporary joint venture (UTE) |
| V | Other types not listed |
| W | Spanish permanent establishment (e.g. branch) of a non-resident entity |
What is the NIF number in Spain?
A NIF (Número de Identificación Fiscal) is the tax identification number used in Spain for any operation with tax implications. For Spanish citizens, it is the DNI number (8 digits + a letter). For foreigners, it is the NIE (X, Y or Z + 7 digits + a letter).
It is highly probable that you don’t need to request a CIF.
In fact, if you are going to carry out any kind of financial or legal procedure personally, you just need your NIF.
The NIF is equal to your Spanish ID number, which can have two different forms:
- If you are a Spanish national, it is called DNI. Then it will be made up of 8 digits and a control letter (e.g. 12345678Z).
- But if you are a foreigner, your NIF will be the same as your NIE, made up of an initial letter (X, Y or Z), 7 digits and a control letter (e.g. X1234567L).
Both of these two numbers are issued by the Interior Ministry in Spain (Policía Nacional).
NIF K, L and M: if you don’t have a DNI or NIE
If you need a NIF but don’t have a DNI or NIE, the Tax Agency (AEAT) can assign one with Form 030:
- K: Spanish nationals under 14 who live in Spain.
- L: Spanish nationals living abroad who are not required to have a DNI.
- M: foreigners who do not have a NIE.
These numbers are issued by the Tax Agency, not the Police, and are only valid for tax purposes. They don’t give you any right to live or work in Spain.
How to get a NIF as an individual
- Spanish nationals: your DNI already works as your NIF.
- Foreigners: apply for your NIE (form EX-15) at a police immigration office in Spain or at a Spanish consulate abroad. Once you have it, it is also your NIF.
- No DNI or NIE: ask the Tax Agency for a NIF K, L or M with Form 030 (see above).
NIF number example
Again, the NIF if you are a foreigner is your NIE, so you must check your TIE to find it or, if you are an EU citizen, your registration certificate (certificado de registro).
And if you are a Spanish national, it is the 8-digit + letter you will find on your DNI.
Where can I get my tax identification number in Spain?
Depending on the particular situation, the number will be obtained in one place or the other.
First of all, if you are a Spanish national, you already have your DNI or if you have just obtained citizenship, you will obtain this basic ID for Spaniards at the closest police station (you will need an appointment for that).
On the other hand, if you are just a resident, then the NIE will work as your NIF, as we mentioned before. In our complete guide to obtaining your NIE, we explained how to get it step by step, but you have two different options:
- Get one directly in Spain, at the immigration office or police station, with form EX-15
- At the Spanish consulate or embassy if you are still in your country of origin. This is usually the case for non-residents who have a property in the Spanish territory, or for those applying for their residency card (the NIE comes along with your visa).
There are certain situations in which you can directly apply for your NIF at the Spanish tax agency with Form 030 (without requesting your NIE at the Ministry of Interior):
- If you are a Spanish national under 14 living in Spain.
- If you are a Spanish citizen who has her residency abroad and no valid DNI.
- If you are a foreigner who does not have a NIE.
If you are to set up a company, you will need to get your CIF through Form 036, which the notary usually files when the company is incorporated (see “How a company gets its NIF” above).
Differences between the NIF and the DNI
Whereas the DNI is the document that identifies Spanish citizens in general for any kind of legal activity, the NIF is required for those operations that have a tax or customs implication.
In that sense, if the authorities need to identify yourself generally speaking, if you need to sign any document or you must travel abroad, then the DNI (as a Spanish national, if you are a foreigner the NIE) will be the ID requested.
But if the procedure you are carrying out has a financial nature and is related to your personal taxes, then you will use the NIF. In practice, the number is the same: your DNI number is also your NIF. What changes is what you use it for.
Is a Spanish NIF the same as a VAT number?
Not automatically. To invoice businesses in other EU countries without charging Spanish VAT, a company or freelancer must register in the Registro de Operadores Intracomunitarios (ROI) with Form 036. Their VAT number (NIF-IVA) is then “ES” followed by their NIF (for example, ESB12345678), and other businesses can check it in the EU’s VIES database.
If you only operate within Spain, your NIF is enough to issue invoices.
Does having a NIF make me a tax resident in Spain?
No. A NIF is only an identification number. Tax residence depends on other criteria, such as spending more than 183 days a year in Spain or having your main economic interests here.
FAQs about CIF and NIF in Spain
Is CIF still used in Spain?
Legally, no. Since 1 January 2008 (Royal Decree 1065/2007), every tax identification number is called NIF, including companies’. In everyday language and on many invoices, people still say CIF to refer to a company’s NIF. The number itself did not change.
Is my NIE also my NIF?
Yes. For foreigners, the NIE number is also their NIF for all tax purposes, so you don’t need a separate tax number. If you don’t have a NIE, the Tax Agency can assign you a NIF M for tax procedures only.
Does a freelancer have a CIF?
No. A freelancer (autónomo) is an individual and invoices with their personal NIF: their DNI or NIE. The CIF only exists for companies and other entities. If the freelancer later sets up a company, such as an SL, the company will get its own NIF (CIF).
How can I check a Spanish company’s NIF?
The NIF must appear on the company’s invoices and in the legal notice of its website. You can also find it in the Mercantile Registry. If the company trades with other EU countries, you can check its VAT number (ES + NIF) in the EU’s VIES database.
Request legal assistance with your tax numbers
Now you already know the main differences between the NIF, CIF, NIE, and DNI. But perhaps you still have some doubts, our need legal assistance to apply for any of them.
If that is the case, you just need to book an appointment so one of our lawyers can get in touch.
We will guide you step by step and manage the whole procedure so you don’t need to worry about anything.
Choose the date that suits you best for a consultation with our lawyers, and let us guide you step by step.
Related content of interest: