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 

Share the Post:

These articles might interest you

Back to top