OUR EXPERT
Brenda L.

Written by

Brenda.L

After completing her higher education, Brenda joined AnchorLess in 2023. She is an expert on relocation issues in Europe.
WHY YOU CAN TRUST ANCHORLESS
+10,000
Expats guided
1194

reviews noted 4.9/5

NIF Icon

Get your Spanish NIF now

Start my application

NIF Spain
Tax ID Spain
24/04/2026

NIF Spain: Application Guide & Differences

NIF Spain document guide

The NIF in Spain is the tax identification number used for tax purposes and official dealings with the Spanish tax administration. For Spanish citizens, the NIF usually matches the DNI. For most foreign individuals, it usually matches the NIE. If a foreigner needs a tax ID before having a NIE, Spain may assign a temporary NIF M. Companies and other legal entities also need a NIF to operate and comply with tax rules in Spain.

If you are moving to Spain, buying property, starting a business, signing certain contracts, or handling other tax-related formalities, understanding the NIF number in Spain is one of the first practical steps. And it is also one of the most misunderstood.

This guide is for foreigners buying property, working, investing, or running a business tied to Spain, including people who are not living there yet. It covers what the NIF is, how it differs from the NIE, who needs one, how to apply, the documents involved, how to check a number, and what tax obligations come attached.

The simplest way to get your company's Spanish NIF

The NIF (Número de Identificación Fiscal) is the tax ID the Spanish authorities assign to your business. Any foreign company selling on a Spanish marketplace, registering for EPR compliance, or running a one-off operation in Spain needs one. It's what lets the Agencia Tributaria recognize your company on Spanish soil, even without a local office or subsidiary.

Start my application now

Arrow icon
Icon check

Receive your company's Spanish NIF in 48 hours

Icon check

No paperwork, notary, or translations needed

Icon check

We file directly with the Agencia Tributaria

Portuguese NISS

What is the NIF in Spain?

The NIF, Número de Identificación Fiscal, is Spain's tax identification number. It is the code the tax system uses to identify anyone (a person or a company) doing something with tax relevance in Spain. It is administered by the Agencia Tributaria (AEAT), Spain's tax authority.

Think of the NIF number in Spain as your fiscal fingerprint. File taxes, open a bank account, sign a contract, buy a property, draw a salary, issue an invoice: the tax identification number sits underneath all of it. Spain's tax regulation is direct on the point. Individuals and legal entities must hold a NIF for dealings with tax relevance.

Here is the part that confuses almost every newcomer. The Spanish tax identification number is rarely a brand-new number you receive. It is usually a role attached to a document you already have:

  • Spanish citizens: the NIF is the DNI number plus its control letter.
  • Foreign individuals: the NIF is normally the NIE.
  • Companies and entities: the NIF is a separate code, starting with a letter that signals the legal form.

So when a foreigner in Spain says "I need a NIF," nine times out of ten they need a NIE, because the NIE is what does the fiscal job.

The difference that actually matters

NIF, NIE, DNI, and CIF are not four competing numbers. They are different labels, and for most foreign individuals the NIE simply is the NIF. The confusion is the single biggest source of wasted appointments.

Here is the difference in one table:

Term What it is Who uses it Link to the NIF
DNI National identity document for Spanish citizens Spanish nationals A Spanish citizen's DNI is their NIF
NIE Foreigner identity number, issued by the Ministry of the Interior Foreigners with an interest in Spain A foreign individual's NIE works as their NIF
NIF Tax identification number Everyone with tax-relevant activity in Spain The umbrella concept for both people and entities
CIF Old company tax ID label Still said out loud, but formally retired Merged into the NIF for companies in 2008

The CIF point trips up businesses. Spain folded the old Código de Identificación Fiscal into the NIF system back in 2008. The number and its function did not change, only the name. Walk into any office in Spain and people will still ask a company for its "CIF." They mean its corporate NIF. You can hand it over without correcting anyone.

So the practical rule on NIE vs NIF: if you are a foreign person signing as yourself, your NIE is your NIF. If you are signing for a registered company, you use the company's NIF (the artist formerly known as CIF).

Who needs a NIF in Spain?

Any natural person or legal entity carrying out an operation with tax relevance in Spain needs a NIF, and you do not have to live in Spain to be on the hook. That last clause is where foreigners get caught.

AEAT's own examples of tax-relevant operations include an employment contract, property purchase documents, and university admission. In real life, here is who needs one.

Foreign individuals

If money is moving and it touches Spanish soil, you need the number. Foreign individuals need a NIF (in practice, a NIE) to:

  • Buy, sell, or inherit property. A notary will not sign the deed (escritura) without it. Inherit a flat or a Spanish bank account, and you need a NIF to settle inheritance tax before the asset goes into your name.
  • Open a bank account or take a mortgage. Some banks open a non-resident account on a passport alone, then ask for the NIF within a few months to keep it live.
  • Work or go freelance. No company can register you with Social Security without it. As an autónomo, you need it to invoice and handle VAT.
  • Run daily life: utilities, a car registration, private health insurance for a visa.

Non-resident investors

You can be a non-resident and still need a Spanish tax number. Buy a holiday home you rent out, hold Spanish shares, or receive Spanish-source income, and the NIF is what ties you to the filing.

Foreign companies and business in Spain

A legal entity needs its own NIF to operate. Foreign companies selling into Spain or setting up locally apply for a corporate NIF, and the trigger is often quieter than people expect. An e-commerce seller who has never set foot in Spain but stores stock in a Spanish warehouse (think Amazon FBA) can be required to register a foreign-entity NIF to handle Spanish VAT. If your business in Spain issues invoices, signs contracts, or files returns, the NIF is the entry ticket.

The simplest way to get your company's Spanish NIF

The NIF (Número de Identificación Fiscal) is the tax ID the Spanish authorities assign to your business. Any foreign company selling on a Spanish marketplace, registering for EPR compliance, or running a one-off operation in Spain needs one. It's what lets the Agencia Tributaria recognize your company on Spanish soil, even without a local office or subsidiary.

Start my application now

Arrow icon
Icon check

Receive your company's Spanish NIF in 48 hours

Icon check

No paperwork, notary, or translations needed

Icon check

We file directly with the Agencia Tributaria

Portuguese NISS

How to apply for a NIF

There are three routes to apply for a NIF, and the right one depends on whether you are a foreign individual, a foreigner without a NIE who needs a number fast, or a company. Pick the wrong route and you queue for the wrong office.

Route 1: foreign individual (get the NIE)

Because your NIF is your NIE, the standard NIF application for a person is really a NIE application.

  • Where: at an Immigration Office or a National Police station inside Spain, or at a Spanish consulate if you are still abroad.
  • The form: EX-15, the Solicitud de Número de Identidad de Extranjero.
  • The fee: the Modelo 790, código 012 tax, paid at a collaborating bank.
  • The catch: you must state the economic, professional, or social reason for the request, and you cannot be in Spain irregularly.

The Ministry of the Interior sets a target of five days to resolve the request from the moment it enters the competent office's register. If no answer comes after that period, the request is understood as rejected, and you start again.

Route 2: foreigner without a NIE (Form 030, the NIF M)

If you need a tax ID urgently and do not yet have a NIE, you can ask AEAT directly using Form 030 for a temporary NIF M. More on what that is, and its catch, below.

Route 3: companies (Form 036)

A company applies for its corporate NIF through Form 036 (Modelo 036), the census declaration. The request is generally made within one month of the entity's constitution or establishment in Spain. Foreign companies submit incorporation deeds and a certificate of good standing, apostilled or legalised, with a sworn Spanish translation. The signing representative needs their own valid Spanish NIE/NIF first, which is why many foreign companies appoint a local representative by power of attorney.

What documents you need

For an individual NIF, you need proof of identity, proof of your NIE situation, and a document proving the tax-relevant reason. A representative needs a power of attorney. AEAT is specific about this for the Form 030 / NIF M route.

Requirement What counts
Identity A valid passport or equivalent national identity document proving identity, age, and nationality
NIE status Proof that you have requested a NIE, or proof you are not required to have one
Tax-relevant reason A document proving the operation: employment contract, property purchase papers, or a university admission letter
Representation If someone files for you, a power of attorney authorising them to submit the application

For the NIE route (Route 1 above), the core set is the completed EX-15, the paid Modelo 790 código 012, your valid passport with a full copy, and the documentary proof of your reason for needing the number.

A word from the field. Recent expat reviews and forum threads through 2025 and 2026 describe the friction as the appointment, not the paperwork. People report weeks of hunting for an in-person cita previa, and being sent to the wrong window more than once. The documents are rarely the wall. The booking system often is. (Reported experience, not an official figure.)

What is the NIF M?

The NIF M is a temporary tax number AEAT assigns to a foreigner who does not have a NIE but needs to complete a tax-relevant operation. It is a bridge, not a destination. It is valid only until you get a DNI or NIE.

AEAT's Form 030 guidance lists three special starting letters for individuals: K for Spanish minors under 14 resident in Spain, L for non-resident Spaniards not required to hold a DNI, and M for foreigners without a NIE.

Two practical points decide whether the NIF M is right for you.

It often needs a presenter. AEAT's online Form 030 route requires the person submitting it to already hold a NIF in the taxpayer census and to identify with an electronic certificate, DNIe, or Cl@ve. Translation: many applicants cannot file it alone and need a representative who can.

It expires into your NIE. Once you obtain a NIE, you must tell AEAT and anyone who holds your fiscal number, within two months. If you end up with both an AEAT-assigned NIF and a DNI or NIE, the DNI or NIE prevails. For most foreigners settling in Spain, the NIE is the number to aim for. The NIF M just keeps a deal alive while you wait.

Company NIF prefixes

A Spanish company NIF is nine characters: one letter for the legal form, seven digits, and one control character. The letter tells you what kind of entity you are dealing with. The codes come from Orden EHA/451/2008, the regulation that defines them.

Letter Entity type
ASociedad Anónima (public limited company)
BSociedad de Responsabilidad Limitada (limited liability company, the common SME form)
CSociedad Colectiva (general partnership)
DSociedad Comanditaria (limited partnership)
EComunidades de bienes and other entities without legal personality
FSociedad Cooperativa
GAsociaciones (associations)
HComunidades de propietarios (homeowners' communities)
JSociedades Civiles (civil partnerships)
NForeign legal entities
PCorporaciones Locales (local public bodies)
QOrganismos públicos (public bodies)
RReligious congregations and institutions
SState and regional administration bodies
UUniones Temporales de Empresas (joint ventures)
VOther types not covered above
WPermanent establishments of non-resident entities
NIF Spain model document

For foreigners, the two that matter are N and W. An N number is for a foreign entity without a permanent establishment in Spain (the Amazon FBA seller is a typical case). A W number is for a foreign company operating through a permanent establishment, like a branch or office, on Spanish soil.

The letter never changes the tax function of the number. It is a label, so A12345678 reads as a Sociedad Anónima and B12345678 as a Sociedad Limitada at a glance. Useful when you are checking that a supplier or partner is registered under the legal form they claim.

How to verify a NIF number

To verify a NIF number, use the Agencia Tributaria's official validation service for third parties. Independent calculators can check the control character, but only AEAT confirms the fiscal status behind a number. This matters when you are invoicing a Spanish client or onboarding a partner and need to know the number is real and active.

There are two layers to a check, and people confuse them:

  • Format and control character. The final letter or digit is generated by an algorithm, so a free verifier can flag a number that is mathematically impossible. That catches typos, not fraud.
  • Fiscal status. Whether a number is genuinely registered and in good standing with the tax authorities is a question only AEAT's own validation service answers. This is the check that protects you on a real transaction.

For intra-EU dealings, there is a third layer. A Spanish operator's intra-community VAT number (the NIF-IVA, your NIF prefixed with ES) can be checked in VIES, the EU-wide system, to confirm a counterpart is registered for cross-border VAT. If a number is not in VIES, the tax administration has not cleared it for those operations.

What the NIF does and does not mean for tax

Holding a NIF or NIE creates tax obligations only when you actually have tax-relevant activity in Spain. The number identifies you. It does not, by itself, make you a tax resident. Getting this wrong costs people real money in over- or under-filing.

Your tax obligations with a NIF depend on what you do, not on owning the number. Three points keep most foreigners out of trouble.

The NIF is not a residency switch. Spanish tax residency for individuals turns on facts: staying in Spain more than 183 days in the calendar year, or having your main base or centre of economic interests in the country. Plenty of foreigners hold a NIE for a property purchase or an inheritance while remaining non-resident for tax purposes. The tax identification number NIF exists so Spain can identify you in dealings with tax relevance in Spain, and nothing more.

Non-resident owners still file. Own a property in Spain as a non-resident and you have an annual non-resident income tax filing (the IRNR, Modelo 210), whether the place is rented or sitting empty. The NIF is what that return runs on.

A normal NIF is not a VAT number. If your business does certain intra-EU operations, you register separately in the ROI (the Register of Intra-Community Operators) through Modelo 036 to obtain the NIF-IVA. Having a NIF does not grant it automatically.

Common mistakes

Most NIF problems trace back to five wrong assumptions. Clear them and the process gets short.

"Spain has a NIF like Portugal." Different doors. In Portugal a foreigner often requests a NIF directly. In Spain a foreigner usually needs a NIE, and that NIE becomes the NIF.

"NIE and NIF are two separate numbers for me." Usually they are the same number wearing two hats. For a foreign individual, the NIE is the NIF.

"The NIF M is permanent." It is temporary, valid until you get a DNI or NIE, and you have two months to report the new number once you do.

"A NIE means I can live in Spain." It does not. The NIE identifies you. Living rights come from EU registration, a visa, a residence authorisation, or a TIE, depending on your case. A number is not a permit.

"My NIF-IVA is automatic." It is not. Intra-EU VAT operations need ROI registration through Modelo 036, and then you appear in VIES.

The simplest way to get your company's Spanish NIF

The NIF (Número de Identificación Fiscal) is the tax ID the Spanish authorities assign to your business. Any foreign company selling on a Spanish marketplace, registering for EPR compliance, or running a one-off operation in Spain needs one. It's what lets the Agencia Tributaria recognize your company on Spanish soil, even without a local office or subsidiary.

Start my application now

Arrow icon
Icon check

Receive your company's Spanish NIF in 48 hours

Icon check

No paperwork, notary, or translations needed

Icon check

We file directly with the Agencia Tributaria

Portuguese NISS

How can AnchorLess help you?

Getting a NIF yourself is free. The cost shows up as time: the cita previa that never appears, the form filled in the wrong field, the official who sends you to the wrong office.

Our Spanish NIF and NIE service handles the application end to end, online, so you do not have to chase appointments or decode forms. We confirm which route fits your situation (NIE, NIF M, or company NIF), prepare the paperwork, and keep your name, surname, and number consistent across every document, which is the detail that most often forces a restart. We have done this for thousands of people moving to Spain and across Europe, and our team is reachable by chat and free calls while it runs.

If you are not sure whether you need a NIF, a NIE, or both, that is exactly the first thing we sort out, before you book anything.

Final takeaways

The NIF question in Spain is really a translation problem. Foreigners arrive expecting Portugal's logic and queue for the wrong document.

Get the mapping right (foreign person equals NIE equals NIF, company equals its own NIF, no NIE yet equals a temporary NIF M) and the rest is paperwork. Hold the number, but remember what it is: an identifier, not a residence permit and not a tax-residency verdict.

Those are separate questions, with separate rules, and the difference is what keeps your move clean.

Share this article

Share this article

Join a community of 10,000+ expats
Get the weekly tips, success stories, and step-by-step guides we share with our members to make their move a success.
Star Trustpilot
Star Trustpilot
Star Trustpilot
Star Trustpilot
Star Trustpilot
I love AnchorLess! They have been fantastic for my move to Portugal with the NIF, checking account, lawyer and tax consultation. I will be happy with when this process is over, but at least the journey has been smoother with them.
LD
Lisa D
From South Africa
Star Trustpilot
Star Trustpilot
Star Trustpilot
Star Trustpilot
Star Trustpilot
Guilherme was the best! I had so many questions and moving parts and he was responsive, always professional, and went above and beyond to help me with everything! He is a PRO!!!!
DS
Debra Savage
From The United States

Our readers also viewed

psain dni expat support number
Moving to Spain
Spain Documents
24/04/2026
Confused by Spain’s número de soporte? Learn what it is, where to find it on a TIE, EU registration ...
Brenda
Brenda
Content Manager
eu family member card
EU Family Member Card Spain
Moving to Spain
01/04/2026
Get your EU Family Member Residence Card in Spain. Step-by-step application guide: documentation, fi...
Brenda
Brenda
Content Manager
Beach Portugal

Start your new life in Europe

Turn relocation stress into success with AnchorLess.

Relocating to Europe made simple.

Start to relocate now

Arrow icon
Talk to us for free
AnchorLess support team
4.9/5 Excellent
Star
Star
Star
Star
Star
Logo AnchorLess

AnchorLess is not a bank, accountant, tax advisor, investment advisor, or law firm, nor are we a government or official government website. We act as an intermediary, helping connect you with accredited professionals and streamlining administrative processes for your relocation in Europe.

Instagram icon
Reddit icon
Linkedin icon
Amex logo
Visa logo
Mastercard logo
& more
Pay 4X free of charge with
Klarna logo

🇵🇹 MOVE TO PORTUGAL

Arrow

🇪🇸 MOVE TO SPAIN

Arrow

🇮🇹 MOVE TO ITALY

Arrow

Resources

Terms and conditions

Privacy Policy

Disclaimer Policy

© 2022 - 2026 anchorless.io, all rights reserved.