The NIE (número de identidad de extranjero, foreigner identity number) is the number the Spanish authorities use to identify a person who does not hold Spanish nationality. You need it for almost anything with an economic effect in Spain, from working to buying a home or paying tax. And it is yours for good. This post is part of our guide to foreigners in Spain: NIE, Social Security and tax.
Here is what it is exactly, who needs it, how to apply in Spain or at a consulate and how it differs from the TIE and the green certificate, which are documents that carry it.
What the NIE is
The immigration regulation defines it as a personal, unique, exclusive and sequential number given to a foreign national for identification. It must appear on every document issued to them or processed for them, except visas (article 205 of Real Decreto 1155/2024, which approves the regulation of Ley Orgánica 4/2000 and has been in force since 20/05/2025). It replaced Real Decreto 557/2011, which covered the NIE in its article 206.
The NIE is also your tax number. For people without Spanish nationality, the tax identification number (NIF) is the NIE assigned to them under immigration law (article 20.1 of Real Decreto 1065/2007). You use it with the tax agency, Social Security, your bank or your employer.
It is written as a letter, seven digits and another letter, with no spaces or hyphens, as the Ministry of Justice explains on its Cl@ve registration page.
Who needs it
Article 205.1 of the regulation lists three groups of foreign nationals who are given an NIE:
- people who start a procedure for a document that lets them stay in Spain, such as a residence authorisation;
- people with an open immigration file;
- people whose link with Spain is economic, professional, social or of any other kind, even if they do not live here.
In practice, you need it to work in Spain, register as self-employed, buy or sell property, receive an inheritance or file taxes. For dealings with tax consequences you need a tax identification number (sixth additional provision of Ley 58/2003, the General Tax Law). As a foreign national, that number is your NIE.
How to get it
Automatically, if you are going to live here
If you start a residence procedure, the Dirección General de la Policía (National Police) assigns your NIE automatically, without a separate application (article 205.3). The same applies to visas that allow you to be in Spain for more than 90 days in any 180-day period without another authorisation. EU citizens receive it when they register with the Registro Central de Extranjeros: their registration certificate shows the NIE (article 7.5 of Real Decreto 240/2007).
On request, if you only have interests in Spain
If you are not going to live here but need an NIE for business, a purchase or an inheritance, you apply for it yourself. You must meet two requirements: not be in Spain irregularly and explain why you are applying (article 205.3).
- If you are in Spain: you apply in person to the Dirección General de la Policía, at an Oficina de Extranjería (immigration office) or a police station.
- If you are abroad: you apply through a Spanish consulate, which forwards it to the Comisaría General de Extranjería y Fronteras (article 205.4).
According to the National Police's online office, you hand in form EX-15, the application for an NIE and certificates, together with proof of payment of the fee on form 790, code 012. Take your valid passport or national identity card too: as a foreign national you must keep it and show it when asked (article 204).
The law sets a maximum of five days to decide and notify you from the date the application is registered. If there is no answer in that time, the application counts as refused (article 205.4). You can then file an appeal for reconsideration (recurso de reposición) within one month, according to the same online office.
NIE, TIE and green certificate: not the same
The NIE is a number. The TIE and the registration certificate are documents that carry it, each for a different kind of person.
| NIE | TIE | EU citizen registration certificate | |
|---|---|---|---|
| What it is | An identification number | A card proving your legal status in Spain | A certificate proving your entry in the Registro Central de Extranjeros |
| Who it is for | Any foreign national with links to Spain | People from outside the EU with a visa or authorisation for more than six months | EU and EEA citizens living in Spain for more than three months |
| When to apply | When you need it | Within one month of arriving or of the authorisation | Within three months of arriving |
| Validity | Permanently yours | The same as the authorisation it proves (article 209.7) | Real Decreto 240/2007 sets no period of validity for it |
| Law | Article 205 of Real Decreto 1155/2024 | Article 4.2 of Ley Orgánica 4/2000 and article 209 of Real Decreto 1155/2024 | Article 7.5 of Real Decreto 240/2007 |
"Green certificate" is the everyday name for the registration certificate. Family members who are not EU citizens get a different card, the residence card for family members of an EU citizen, which they apply for within the same three months (article 8 of Real Decreto 240/2007).
Each of these documents also has a support number (número de soporte), different from the NIE, which identifies that particular card or certificate. You are asked for it, for example, when you register with Cl@ve (the government's online login system). We explain it in the support number on a DNI or NIE document.
What the NIE does not do
- It does not give you permission to live or work here. If you are not from the EU, to work you need a residence and work authorisation (article 36.1 of Ley Orgánica 4/2000).
- It does not make you tax resident. That depends on the days you spend in Spain and your economic interests. See tax residency versus legal residence.
- It does not register you with Social Security. To work you also need a Social Security number.
If you have an NIE and will be self-employed
With your NIE you can register as an autónomo (self-employed) and get your digital certificate to file taxes. If you like, Facturaz handles your autónomo registration for €49 + IVA and your digital certificate for €84 + IVA. The full route is in how to become an autónomo in Spain.