Practical guide: What is the NIF (Tax Identification Number) and how to obtain it? 

Table of Contents

Introduction

The NIF (Tax Identification Number) is the key tax number for all procedures with the Public Treasury in Spain (Agencia Tributaria). Note that it should not be confused with the NIE (Foreigner Identification Number) or the DNI (Spanish National Identity Document).

What is the NIF for? 

Each country has its own tax identification system. In Spain, this system is based on the NIF. 

This unique identifier is assigned: 

  • To Spanish and foreign individuals.
  • To legal entities and companies

For what types of activities do I need an NIF? 

You will need an NIF for all your fiscal and financial activities on Spanish territory

  • Filing tax returns;
  • Issuing invoices;
  • Banking and financial operations; 
  • Social security contributions;
  • And any other tax-related procedure in Spain. 

Good to know: you can obtain a NIF without a DNI (Documento Nacional de Identidad) and without a NIE, the famous Foreigner Identification Number

What are the general characteristics of the NIF? 

Format 

The NIF is an alphanumeric code composed of 9 characters that differ depending on the applicant's situation

  • For Spanish individuals: 8 digits + 1 letter.
  • For foreigners: 1 letter (X, Y, Z) + 7 digits + 1 letter.
  • For legal entities: 1 letter that identifies the legal form + 7 digits + 1 control character (this can be a letter or a number).

What is the CIF? 

The CIF is the Tax Identification Code for Spanish companies. It was replaced by the NIF in 2008. 

The 3 types of NIF

1- The NIF for individuals

  • For Spaniards with a DNI, the NIF corresponds to the DNI (but its use is exclusively for tax purposes).
  • For foreigners with a NIE, the NIF corresponds to the NIE.
  • There are special cases: we have listed them in the table below. 
KMinors under 14 years of age, Spanish residents in Spain
LNon-resident Spaniards of any age, not required to have a DNI
MForeigners who do not have a NIE

2 – The NIF for legal entities

The NIF begins with a letter that indicates the legal form of the company, as we said + 7 digits + a control character (letter or number).

LetterType of structure
ASA (Public Limited Company)
BSL (Limited Liability Company)
CGeneral partnerships
DLimited partnerships 
EJoint ownership
FCooperatives
GAssociations
HCondominiums
JCivil companies
NNon-resident entities
PLocal entities
QPublic bodies
RReligious institutions
SAdministrations
UTemporary consortiums of companies 
VOther entities
WPermanent establishments of foreign companies

3 – The intra-community VAT number (NIF-IVA)

To carry out operations within the European Union, you must use the NIF-IVA, the intra-community VAT number

  • It consists of the letters ES (for Spain) and your NIF.

It allows you to issue and receive invoices exempt from VAT. 

Obtaining a NIF: A practical guide

For individuals without commercial activity: modelo 030

Two scenarios for individuals

  • If you already have a DNI or NIE, no action is required: your NIF is the same.
  • Otherwise, or if you need to modify your tax situation, use form 030 

Note that having a NIF is essential if you buy a property for rental in Spain, as you will have to declare taxes there, even if you live abroad (IRNR). 

Instructions 

  1. Go to the Agencia Tributaria website and complete the process online.
  2. Fill in form 030 and provide the required documents.
  3. List of required documents
  • Valid passport or identity card.
  • Proof of residence.
  • Copy of the family record book or a birth certificate for minors, as well as the passport or identity card of the parents (same for representatives of persons under guardianship).
  • If the application is made by a representative: identity documents of the representative and power of attorney. It must be notarized, apostilled and translated by an official translator.

You can also generate the PDF, print it in duplicate, sign it and send it by post to the AEAT or the consulate. You can also make an appointment on site. 

  • Please note: the PDF version is considered a draft until it has been submitted to the AEAT, and it is valid for 1 month.
  • You will receive your NIF automatically by email once the application has been validated by the AEAT services. There is no official deadline.

For legal entities, the modelo 036

In 2025, the modelo 036 has been extensively redesigned and simplified. 

Until now, there was a slightly different version, the modelo 037. Legal entities had to complete one or the other depending on their situation. To simplify the process, the tax authorities have removed the modelo 037. 

Scenarios for legal entities

  • If you are launching a business, a real estate company, an association or any other type of structure, you must register it with the tax authorities using form 036.
  • By declaring yourself as self-employed (autónomo), your DNI or NIE automatically becomes your NIF. However, you must register for taxes using the same form. 
  • If you are a foreigner without a NIE, you must first obtain a NIE

Important: if you have just created a company, the NIF application must be made to the Agencia Tributaria within one month

Instructions 

  1. If you have a certificado digital or the cl@ve digital identification system, you can complete your application directly online on the Agencia Tributaria website via the modelo 036: "solicitud de asignacion de NIF de entidad, no presencial"
  2. If you do not have a digital identification method:
  • An authorized representative can do it online for you (a gestor, for example).
  • You can also fill out the modelo 036: “Cumplimentación, validación y obtención en PDF para su impresión”. You will then need to generate a PDF and print it (in 2 copies) to present it in paper form to the AEAT office with the necessary documents.
  1. List of documents to provide: They depend on the legal form of the entity you are registering, but as a general rule, you will be asked for: 
  • The passport or identity card of the signatory.
  • Proof of the NIF or NIE of the representative.
  • A copy of the notarized articles of incorporation (escritura blica).
  • The company's articles of association.
  • The certificate of registration in the public registry.  
  • Proof of residence. 
  • The power of attorney, if necessary. 
  • Please note: the PDF remains a draft until it is submitted to the AEAT. It is valid for 1 month. 
  • The NIF is assigned by email as soon as your request is validated.

The legal entity will not be able to obtain a NIF if the legal representative or the partners do not have a NIF themselves. 

Good to know: recently, a new process has been put in place to easily complete the modelo 036 with the help of AI to obtain your NIF online. It is called Censos web

Watch the explanatory video here: https://youtu.be/8d-KqZ9c3_g TO BE PLACED DIRECTLY ON OUR PAGE

In practice: 

  • For an in-person submission, make an appointment online on the AEAT website via the Asistencia y Cita section of their website or by telephone: +34 91 290 13 40 or +34 901 200 351.
  • Foreign documents must be translated and apostilled.

Official resources 

FAQ — Tax ID in Spain

What is the NIF in Spain?

The NIF (Número de Identificación Fiscal) is the tax identification number used by the Spanish government to identify taxpayers in their dealings with the tax authorities.

What is the NIF used for in Spain?

The NIF is required for all tax and administrative procedures in Spain. In particular, it is necessary for paying taxes, signing certain contracts, starting a business, or conducting financial transactions.

What is the difference between a NIF and an NIE?

The NIE is the identification number assigned to foreign nationals in Spain. For foreign individuals, the NIE generally also serves as the NIF for tax purposes.

Who needs to obtain a tax identification number in Spain?

Any individual or business entity that needs to handle tax matters in Spain must have a NIF, including foreigners and companies.

Do foreigners need a tax identification number in Spain?

Yes. Foreigners who conduct economic or tax-related transactions in Spain must have a NIF, which is usually the same as their NIE number.

Do businesses need to have a tax identification number in Spain?

Yes. Companies and legal entities must obtain a tax identification number (NIF) in order to conduct business, pay taxes, and carry out transactions.

Can you buy real estate in Spain without a NIF?

No. Any real estate transaction involves tax obligations. Buyers must therefore have a tax identification number.

Is a NIF required to start a business in Spain?

Yes. A TIN is required to incorporate a company, report business activities, and fulfill tax obligations.

Can you open a bank account in Spain without a NIF?

In most cases, a tax identification number is required to open a bank account or carry out certain financial transactions.

Is a NIF required to pay taxes in Spain?

Yes. The NIF is the number used by the tax authorities to identify taxpayers and record their tax returns.

How do I obtain a tax identification number in Spain?

You must apply for a NIF through the Spanish tax authorities. For foreigners, the NIF is generally the same as the NIE number assigned by the authorities.

How long does it take to obtain a tax identification number in Spain?

The processing time depends on the applicant’s circumstances and the relevant government agency, but the application can generally be processed quickly once all required documents have been submitted.

Is the NIF valid for life?

Yes. The tax identification number is unique and generally remains associated with the individual or business for life.

Can the same tax ID number be used for multiple business activities in Spain?

Yes. The same tax identification number is used for all tax obligations of an individual or a business.

Is a NIF required to invest in Spain?

Yes. Any economic or financial activity in Spain, including real estate or financial investments, requires a tax identification number.

What is the difference between a NIF and a CIF?

The CIF was formerly used to identify businesses in Spain. Today, the term NIF is used for both individuals and corporations.

Is a NIF required to sign a contract in Spain?

Yes. Many contracts, particularly those involving tax or financial obligations, require a tax identification number.

Can you obtain a NIF without being a resident of Spain?

Yes. Non-residents can obtain a tax identification number (NIF) when they need to carry out tax-related or economic transactions in Spain.

Is the NIF used in all tax-related procedures?

Yes. The NIF is the identification number used by the Spanish tax authorities to identify taxpayers in all their tax returns and obligations.

Why is the NIF important for foreigners in Spain?

The NIF allows foreigners to carry out administrative, tax, and business-related procedures in Spain, particularly when it comes to investing, purchasing real estate, or engaging in professional activities.

Back to top