Last updated: October 2026 – Content reviewed according to current regulations.
The NIF is the Tax Identification Number assigned by the Spanish Tax Agency to individuals and companies. You must have this number to legally invoice clients, pay taxes, and operate a business in Spain.
Who it applies to: Self-employed professionals (autónomos), SMEs, legal entities, and foreign residents conducting taxable economic activities in Spain.
When it does not apply: Tourists and short-term visitors not engaging in any financial, real estate, or administrative transactions.
Exactly Understanding What is NIF
If you are a new entrepreneur wondering what is NIF, the answer lies in its Spanish acronym: Número de Identificación Fiscal. It is a unique alphanumeric identifier assigned by the Spanish Tax Agency (Agencia Tributaria). It serves to track your tax obligations and administrative procedures within the Spanish territory.
Whether you are registering as a self-employed worker, incorporating a Limited Liability Company (SL), or simply filing your annual Income Tax Return, the public administration will request this identifier. It acts as your permanent administrative footprint.
Types of Tax Identification Numbers in 2026
The structure of your tax number depends entirely on your legal status in Spain. While the core function remains the same, the format changes based on whether you are a Spanish citizen, a foreign resident, or a corporate entity.
| Entity Type | Corresponding Document | Format Example | Description |
| Spanish Nationals | DNI (Documento Nacional de Identidad) | 8 numbers + 1 letter (e.g., 12345678Z) | Assigned to natural persons holding Spanish citizenship. |
| Foreign Residents | NIE (Número de Identidad de Extranjero) | 1 letter + 7 numbers + 1 letter (e.g., Y1234567B) | Functions as the tax identifier for non-Spanish citizens conducting business or living in Spain. |
| Legal Entities (Companies, NGOs) | NIF (Formerly CIF) | 1 letter + 7 numbers + 1 number or letter (e.g., B12345678 or N1234567J) | Assigned to companies, associations, and foundations. The starting letter denotes the legal structure (e.g., ‘B’ for SL) and the last character acts as a control code (number or letter). |
Key Differences: NIF vs. NIE and DNI
Many expats and new business owners get confused by the different acronyms used by Spanish authorities. Understanding what is NIF compared to a DNI or NIE is essential to avoid filing errors on official forms.
NIF vs. DNI
For Spanish citizens, the NIF and the DNI share the exact same alphanumeric code. However, their functions differ administratively. The DNI is your national identity card used to prove who you are geographically and legally (e.g., at airports, banks, or police stations). The NIF is that exact same number applied in a tax context, used specifically when interacting with the Tax Agency or Social Security.
NIF vs. NIE
When asking what is NIF for foreign residents, it is important to know that it is exactly the same as your NIE. The NIE is assigned by the National Police to identify you as a foreigner. Once you register with the Tax Agency to start an economic activity, your NIE automatically functions as your Tax Identification Number. You do not receive a second, separate number for taxes.
Why Freelancers Must Use the Tax Identifier Daily
As a self-employed professional (autónomo) in Spain, you will use this identifier in nearly every administrative step of your business.
1. Registering with the Tax Agency and Social Security
Before you can legally work, you must submit Form 036 or 037 to the Tax Agency and register with the RETA (Special Regime for Self-Employed Workers). Both processes strictly require your tax identifier. Without it, you cannot activate your legal status as a freelancer.
2. Issuing Valid Invoices
Spanish billing regulations state that a legal invoice must contain specific elements to be valid. You are required to include your full name, registered address, and your tax number on every invoice you send to a client. Conversely, to deduct a business expense, the supplier’s invoice must also display their respective identifier.
3. Filing Tax Returns
Every quarter, freelancers must file tax returns, such as Form 303 for VAT (IVA) and Form 130 for Personal Income Tax (IRPF). The Spanish tax portal uses your identifier to match these payments to your fiscal profile.

How to Find or Apply for Your Document
If you already possess a physical DNI or TIE (Foreigner Identity Card), your tax identifier is printed directly on the front side of the plastic card. You will also find it on any official document issued directly by the Tax Agency, such as your Income Tax Return draft or your Mercantile Registry registration.
If you are a foreigner planning to start a business and do not yet have an identifier, you must apply for an NIE through the Spanish consulate in your home country or directly at a National Police station in Spain by submitting Form EX-15. Once obtained, you register this number with the Tax Agency through Form 030 or 036 to activate its fiscal validity.
Frequently Asked Questions (FAQs)
1. Can I issue a legal invoice in Spain without a NIF?
No. Spanish tax regulations strictly require your Tax Identification Number to be present on all issued invoices. Without it, the invoice is not legally valid, and your client cannot deduct the expense.
2. Is the CIF still used for companies in Spain?
No. The term CIF (Código de Identificación Fiscal) was officially replaced by the NIF for legal entities in 2008. While you may still hear people use the term CIF conversationally, all official tax forms now use NIF.
3. Do tourists need to apply for a tax number?
If you are visiting Spain solely for tourism, you do not need this number. You only need it if you plan to carry out economic transactions, such as buying a property, opening a resident bank account, or starting a business.
Navigating the Spanish administrative system is much simpler once you have your tax identification sorted. This identifier is the gateway to working legally, filing your quarterly taxes, and operating your business without facing penalties from the Tax Agency. If you need personalized assistance, at Entre Trámites we offer management and tax advisory services for freelancers and SMEs. You can contact us through this contact form for us to call you, or if you prefer, you can schedule a free consultation or write to us on WhatsApp.

