What is a NIF number and why do you need it?
The NIF number in Spain is the universal fiscal identifier: it serves both individuals (Spaniards and foreigners) and legal entities (companies, associations, foundations). Without a NIF, you cannot pay taxes, issue an invoice, open a business account or sign a notarial deed. Yet many expats do not realise they already hold their NIF (because it is the same number as their NIE), and many foreign entrepreneurs ignore that they need a separate company NIF to operate in Spain.
This article explains exactly what the NIF is, how it relates to the NIE for individuals and to the CIF (legacy term) for companies, who needs one, how to obtain it depending on your status, and in which situations a specific NIF is required. We also detail the different company NIF letters (A, B, N, W) and their implications.
What exactly is the NIF?
The NIF is the reference fiscal identifier in Spain, established by the 2008 fiscal reform that unified the legacy terminology.
A simple definition
The NIF (Número de Identificación Fiscal) is the identifier allocated by the Agencia Tributaria to any person (natural or legal) with tax obligations in Spain. This is the number that appears on invoices, contracts, tax returns, notarial deeds, and that allows the administration to link all your economic operations to a single file.
Specifics for individuals
For Spaniards, the NIF is their DNI (national ID card) with a check letter added: for example, if the DNI is 12345678, the NIF is 12345678X (where X is calculated by algorithm). For foreigners, the NIF is simply the NIE. No need to request a separate NIF: your NIE is one automatically. To understand this equivalence, see the difference between NIE and NIF in Spain.
Specifics for companies
For companies, the NIF is a specific identifier distinct from the personal NIE/DNI of the shareholders. It starts with a letter indicating the type of entity: A for Sociedad Anónima, B for Sociedad Limitada, G for association, N for foreign entity without establishment, W for foreign permanent establishment. This is what was called before 2008 the CIF (Código de Identificación Fiscal); the number stayed the same, only the official name changed.
Why do you need a NIF in Spain?
The NIF is required in almost every legal, fiscal or financial operation in the country.
For foreign individuals
You use your NIF (which is your NIE) to open a bank account, file a tax return (modelo 100, modelo 210, modelo 720), sign a notarial deed, conclude a commercial lease, receive an inheritance, register with social security (NUSS), or any other official step. The NIF is mandatory as soon as there is an economic trace of your activity in Spain. To understand the uses, see the NIE in Spain.
For autónomos
The autónomo uses their NIF (= their NIE) on invoices, quarterly returns (modelo 303, modelo 130) and annual returns (modelo 100). The NIF is the identifier that appears on invoices for services to companies or individuals and lets the Agencia Tributaria cross-reference issuer/recipient filings. For status details, see how to become an autónomo.
For companies (SL, SA, etc.)
A Spanish SL needs a specific NIF (starting with B) to start its activity: invoicing, declaring VAT, paying corporate income tax, hiring staff, opening commercial bank accounts. Without a NIF, the company does not exist fiscally. For the full procedure, see the step-by-step guide to setting up an SL and apply for NIF in Spain for foreign companies.
For foreign companies operating in Spain
A foreign company carrying out economic operations in Spain (sales on site, property rental, services invoiced in Spain) must request a Spanish NIF even without a subsidiary. This is what is called NIF type N (foreign entity without establishment) or W (permanent establishment).
How do you obtain a NIF in Spain?
The procedure depends on who you are: individual or company.
For foreign individuals: obtain your NIE
If you are a foreign individual, you automatically obtain your NIF by obtaining your NIE. No additional procedure. For the NIE procedure, see the NIE in Spain and how long it takes to apply for an NIE. Once your NIE is in hand, you can use it as NIF in all your steps.
For Spanish companies: modelo 036
A newly created SL requests its NIF by filing the modelo 036 with the Agencia Tributaria, after signing the notarial deed of incorporation. A provisional NIF is allocated within the week, then converted into a definitive NIF after registration with the Registro Mercantil Provincial. The procedure takes 2 to 4 weeks in total.
For foreign companies: modelo 036 with fiscal representative
A foreign company wanting to operate in Spain without being incorporated there requests its NIF via modelo 036 by appointing a fiscal representative in Spain (who must hold a Spanish NIF/NIE). The articles of the original company must be apostilled and translated by a sworn translator. Lead time: 1 to 3 weeks once the file is complete.
For autónomos: census alta
The autónomo does not need to request a NIF since theirs is their NIE. But they must file the modelo 037 or modelo 036 to register as an active taxpayer and declare their activity. This census alta is mandatory before the first invoice.
What are the different company NIF letters?
The NIF of a legal entity starts with a letter indicating its type. Knowing these letters helps identify the status of any company you encounter in Spain.
The main letters
- A: Sociedad Anónima (SA), large company with capital divided into shares.
- B: Sociedad de Responsabilidad Limitada (SL or SRL), the equivalent of an Ltd.
- C: Sociedad Colectiva.
- D: Sociedad Comanditaria.
- E: Comunidad de Bienes (joint ownership).
- F: Sociedad Cooperativa.
- G: Asociación.
- H: Comunidad de Propietarios (property co-ownership).
- J: Sociedad Civil.
- N: Entidad Extranjera (foreign company without permanent establishment).
- P: Corporación Local.
- Q: Organismo Público.
- R: Congregación e Institución Religiosa.
- S: Órgano de la Administración del Estado.
- U: Unión Temporal de Empresas.
- V: Otros tipos.
- W: Establecimiento Permanente de Entidad No Residente.
In practice, B and A dominate the commercial landscape
Almost every company encountered day-to-day (shops, tradespeople, providers) is an SL (NIF in B). Large listed companies are SAs (NIF in A). Associations and foundations use G. Property co-ownerships (essential for apartment owners) use H.
Why this coding matters
When you receive an invoice, the NIF tells you immediately what type of entity you are dealing with. An invoice issued by an SL (B...) implies IS taxation, public annual accounts, limited liability. An invoice from a comunidad de bienes (E...) is legally different. That information changes the nature of your commercial interaction.
What are the tax obligations linked to the NIF?
Holding a NIF triggers different obligations depending on your status.
Non-resident individual owner
If you have a NIE/NIF because you own property in Spain, you must file every year the modelo 210 on renta imputada or actual rents, and pay the IBI to the town hall. For details, see how much tax you must pay as a non-resident in Spain.
Tax resident individual
If you become a tax resident, you file the annual modelo 100 on your worldwide income and possibly the modelo 720 for your foreign assets. To grasp the status, see how to become a tax resident and the impact of your NIE on your tax status.
Autónomo
The autónomo files modelos 130 (IRPF instalment), 303 (IVA), 100 (annual IRPF), and keeps simplified accounting. For the deeper view, see taxes and social security contributions for autónomos.
Company (SL or SA)
The company files modelos 200 (annual corporate income tax), 202 (quarterly IS prepayments), 303 (quarterly IVA), 390 (annual IVA summary), 111 (monthly IRPF withholdings), 190 (annual withholding summary), and possibly 232 (related-party transactions) and 720 (foreign assets). For details, see taxes for a Sociedad Limitada.
What mistakes should you avoid with the NIF?
A few classic traps repeat and complicate life.
Requesting a NIF when you already have an NIE
For a foreign individual, NIE = NIF. Many expats undertake a redundant procedure with the Agencia Tributaria to "obtain their NIF" when it is enough to use their NIE. That wastes time and adds nothing.
Confusing personal NIF and company NIF
If you set up an SL, its NIF (starting with B) is entirely distinct from your personal NIE/NIF. On invoices issued by the SL, the company NIF must appear, not your personal NIE. The mix-up is a frequent error that complicates accounting.
Using the term CIF in official steps
Since 2008, the official term is NIF (even for companies). "CIF" remains common in everyday speech and on legacy documents, but on official forms write "NIF" to avoid ambiguity.
Forgetting to translate the articles for a foreign company
If you request a NIF for a foreign company operating in Spain, the original articles must be apostilled and translated by a sworn translator. Without that, the file is rejected.
Wrong fiscal representative
The fiscal representative of a foreign company must hold a Spanish NIF/NIE and be based in Spain. Choosing a representative who is uninvolved or poorly informed can cause serious problems in case of a tax audit.
How is your NIF used day-to-day?
A few concrete examples to anchor practice.
On your invoices (autónomo)
If you are a freelancer invoicing a Spanish client, your invoice must show your full name, your NIF (= your NIE), your fiscal address, and the client's NIF. The invoice must also apply the appropriate IRPF withholding (15% generally, 7% in the first year). For the detail of withholdings, see when an autónomo uses IRPF withholding.
On your tax returns
The NIF appears at the top of every modelo. On the modelo 100 (resident), it is your personal NIF. On the modelo 200 (SL), it is the company NIF. A typo can prevent the return from being validated.
At the bank
To open a bank account, the bank asks for your NIF and supports it with a copy of your NIE document (green A4 or TIE). The NIF is then recorded on every banking document.
At the notary
To sign a notarial deed (property purchase, company incorporation, succession), your NIF is mentioned in the deed with your full name and fiscal address. The notary checks the authenticity of the NIE/NIF with the central foreigners' register.
What to remember about your NIF
The NIF number in Spain is the backbone of your fiscal and economic existence on the territory. For foreign individuals, it merges with the NIE and is not an extra step to take. For companies (Spanish or foreign operating in Spain), it is a separate procedure that demands rigorous documentation.
Good administrative hygiene means always using the right NIF depending on the context (personal or company), keeping your supporting documents (NIE document, incorporation deed with company NIF), and updating your data with the Agencia Tributaria if your address or status changes. Common myths are dismantled in nine misconceptions about the NIE number.
Preparing a project that involves a company NIF (SL set-up, opening of a foreign branch in Spain, fiscal representative alta)? At gestoraz, we can manage the full request, from translating the articles to the allocation of the definitive NIF.
Official sources
- Agencia Tributaria, NIF and fiscal identifiers, sede.agenciatributaria.gob.es: rules of allocation and use of the NIF.
- Modelo 036/037, sede.agenciatributaria.gob.es: census declaration forms and NIF request.
- Real Decreto 1065/2007 (BOE), boe.es/buscar/act.php?id=BOE-A-2007-15984: regulation on the NIF and CIF/NIF unification.
- Real Decreto Legislativo 1/2010 (Ley de Sociedades de Capital), boe.es/buscar/act.php?id=BOE-A-2010-10544: legal status of capital companies.
- Registro Mercantil Central, rmc.es: company registration and link with the NIF.
Obtain your Digital Certificate entirely remotely.
Request your Digital Certificate completely remotely.