Tax IDs Decoded: A Clear Overview
Although the names differ, these numbers often overlap in how they are used.
NIE – the number most expats will receive
For foreign residents, the most important number is the NIE (Número de Identidad de Extranjero).
This is the identification number assigned to non-Spanish citizens who have dealings with Spanish authorities. It is issued through immigration or police offices.
An NIE typically looks like this:
X1234567A
The format includes:
an initial letter (usually X, Y, or Z)
seven numbers
a final control letter
For most expats, this number becomes the identifier used for taxes, property ownership, banking, and many legal procedures.
You may hear people refer to the NIE as a “tax number,” but technically it is a foreigners’ identification number that also functions as a tax identifier.
DNI – the identification number for Spanish citizens
Spanish citizens use a different number called the DNI (Documento Nacional de Identidad).
The DNI is both:
the national identity number
and the person’s tax identification number.
The format typically consists of eight digits followed by a letter.
Spanish citizens receive this number as part of their national ID card system, and it automatically functions as their tax ID as well.
NIF – the official tax identification number
The NIF (Número de Identificación Fiscal) is Spain’s formal tax identification number.
However, in practice it is not always a separate number.
Instead:
Spanish citizens use their DNI as their NIF
foreign residents usually use their NIE as their NIF.
So when a form asks for your NIF, you will normally enter the same number that appears on your NIE certificate.
The NIF is required when dealing with the Spanish tax authority (Agencia Tributaria) and appears on most tax-related documents.
Tax identification numbers for businesses
Businesses operating in Spain also require a tax identification number.
Companies apply for a corporate NIF through the Spanish tax authority before beginning business activities.
Historically, companies used a number called a CIF (Código de Identificación Fiscal). Since 2008, the CIF system has been integrated into the NIF framework, meaning all companies now operate under the broader NIF system.
Business tax IDs are used for:
invoicing
paying corporate taxes
registering employees
conducting commercial transactions.
Who issues Spanish tax ID numbers?
Several government bodies are involved in issuing and managing these identifiers.
National Police or immigration offices
Foreign nationals usually receive their NIE through the police or immigration system.
Spanish Tax Agency (Agencia Tributaria)
The Agencia Tributaria manages the tax system itself and oversees the use of NIF numbers for tax purposes.
Commercial Registry
Businesses registering in Spain must also interact with the Commercial Registry when establishing a company and finalising their corporate tax ID.
Tax residency and your tax ID
Having an NIE or NIF does not automatically make you a Spanish tax resident.
Tax residency is determined separately based on factors such as:
spending more than 183 days in Spain during a calendar year
having your main economic activity in Spain
or having your immediate family living in Spain.
If you become tax resident, Spain generally taxes your worldwide income. Non-residents are usually taxed only on income originating in Spain.
Your tax ID number simply allows the authorities to identify you within that system.
Common challenges for expats
Many newcomers find Spanish administration confusing at first. Some of the most common issues include:
Appointment availability
Appointments for NIE applications can sometimes be difficult to obtain, particularly in busy areas.
Documentation requirements
Applications often require specific forms, copies of passports, and supporting documentation depending on the purpose of the NIE.
Language barriers
Official paperwork is normally completed in Spanish, which can make the process more difficult if you are unfamiliar with the language.
Being prepared and keeping copies of all documents can make the process much smoother.
A simple way to think about Spanish tax IDs
The easiest way to understand the system is this:
NIE – identification number for foreigners
DNI – identification number for Spanish citizens
NIF – the tax identifier used within the Spanish tax system
For most expats, your NIE will also function as your NIF.
Once you have this number, it becomes the key identifier used for many official and financial activities in Spain.
How Spain S.O.S. can help
The Spanish administrative system can feel overwhelming at first, particularly when you are dealing with new terminology and unfamiliar processes.
At Spain S.O.S., we help clients understand:
which identification numbers they need
how to obtain them
and how these numbers connect to residency, taxes, and everyday life in Spain.
Our goal is simply to make the process clearer and easier to navigate so you can focus on settling into life in Spain.
If you would like guidance planning your move, you can book a complimentary discovery call with us.

