NIF Spain (2026): What It Is, How It Differs from the NIE, DNI and CIF, and How to Get One

By Arturo García de la Cruz · Immigration Lawyer at MoveWise · Last updated: 6 November 2026

⚠️ Important: This guide explains how the rules work in general. It is not tax advice. MoveWise is an immigration consultancy, not a tax adviser: before you make any tax decision, speak to a qualified tax adviser (in Spain, an asesor fiscal).

💡 The short answer: The NIF (Número de Identificación Fiscal) is the number that identifies you to the Spanish tax authorities. For Spanish nationals it is their DNI number; for foreigners it is their NIE, the foreigner identification number assigned by the Police. Foreigners who need a tax number but do not have an NIE can, in certain cases, request a temporary NIF starting with M from the Agencia Tributaria. Companies have their own NIF, still often called "CIF".

Key facts for 2026

  • Format for individuals: 9 characters. DNI: 8 digits plus a letter. NIE: X, Y or Z, then 7 digits, then a letter (OECD, Spain TIN sheet).
  • Spanish nationals: the DNI serves as the NIF (Agencia Tributaria).
  • Foreigners without an NIE: request an NIF beginning with M from the Agencia Tributaria, on form 030.
  • M-NIF validity: temporary (generally three months) if you are required to obtain an NIE; definitive if you are not.
  • Penalty: not using your NIF in tax-relevant operations is a minor infringement punishable by a €150 fine (Agencia Tributaria).

This guide is for foreigners who meet the letters NIF, NIE, DNI and CIF on Spanish forms, or who are asked for a "foreign tax identifying number" on a foreign form.

It is written by the MoveWise Legal Managers who handle NIE and residency procedures every week, with every rule linked to an official source.

The pitfall we see most: thinking that the NIF is a separate number you must request in addition to your NIE. For most foreigners, it is not.

In this guide:

  • NIF, DNI, NIE and CIF: what each one is
  • When you need a NIF
  • How foreigners get a NIF
  • Using your NIF online with the tax office
  • Keeping your details up to date
  • What "FTIN" means on foreign forms
  • Common mistakes with tax numbers
  • When you need a tax adviser
  • Frequently asked questions
  • How MoveWise can help

NIF, DNI, NIE and CIF: what each one is

NIF: the tax identification number

The Número de Identificación Fiscal (NIF) is the number you use in every tax-relevant operation in Spain. According to the OECD's sheet on Spain, it is unique for tax and customs purposes.

DNI: the NIF of Spanish nationals

The Documento Nacional de Identidad (DNI) is the Spanish national identity card. According to the Agencia Tributaria, Spanish nationals who must hold a DNI use it as their NIF. That is why many forms say "DNI/NIF".

NIE: the NIF of foreigners

The Número de Identidad de Extranjero (NIE) is assigned by the Dirección General de la Policía to foreigners with economic, professional or social interests in Spain. It is a personal, unique and exclusive number, and for a foreigner it also works as the NIF. Our guide on how to apply for an NIE explains the procedure.

CIF: the old name for a company's tax number

"CIF" (Código de Identificación Fiscal) is the name long used for the tax number of companies and other entities, and you will still see it on invoices and forms. Today, entities have an NIF issued by the Agencia Tributaria. The OECD sheet describes its format: a first letter that shows the legal form (for example, N for foreign entities), 7 digits and a control character.

K, L and M numbers

The Agencia Tributaria also assigns NIFs beginning with:

  • K: Spanish residents under 14 without a DNI.
  • L: Spanish nationals living abroad without a DNI.
  • M: foreigners without an NIE.

👉 Moving to Spain for work or remote work? Book a free consultation with a MoveWise Client Manager — we will explain which residence route fits you; your NIE comes with it.

When you need a NIF

You need a tax number whenever an operation has tax relevance, typically when:

  • ✅ Opening a bank account. See our guide to opening a bank account in Spain.
  • ✅ Signing an employment contract or being paid by a Spanish payer.
  • ✅ Buying or selling property, and signing before a notary.
  • ✅ Registering as self-employed. See our autónomo guide.
  • ✅ Filing a Spanish tax return.

The Government's procedures portal adds one useful detail: without an NIE, your passport can be used to register with Social Security during your first six months of residence or stay (one.gob.es).

How foreigners get a NIF

Route 1: your NIE is your NIF

If you are moving to Spain on a residence permit, or you have economic, professional or social interests here, you obtain an NIE from the Police, in Spain or through a Spanish consulate. That number then works as your NIF. The OECD sheet notes that the number also appears on foreigners' residence cards (the TIE).

Read the step-by-step in our NIE guide.

Route 2: a temporary M-NIF from the Agencia Tributaria

According to the Agencia Tributaria, foreigners without an NIE request an NIF beginning with M.

  • ✅ Where: at an Agencia Tributaria office, on form 030. The Agencia Tributaria also mentions Spanish diplomatic missions and consulates abroad; check with yours whether it handles your case.
  • ✅ What to bring if you must have an NIE: the police receipt showing that you have applied for it.
  • ✅ What to bring if you do not need an NIE: the police document that proves it.
  • ✅ Validity: if you must have an NIE, the M-NIF is valid until the NIE is assigned, generally three months, and the deadline is printed on the document. If you are not required to have an NIE, the M-NIF is definitive.

Step by step, if you need an M-NIF while your NIE is pending:

  1. Apply for your NIE at the Police or a consulate and keep the receipt (resguardo) of the application.
  2. Complete form 030, the census form for individuals.
  3. Present form 030 with the police receipt at an Agencia Tributaria office.
  4. Note the expiry date printed on your M-NIF document, and use the number in tax operations until then.
  5. When your NIE is assigned, tell the Agencia Tributaria, and anyone who holds your M-NIF, within two months.

There is also a remote procedure for people without a DNI or NIE who need an NIF for tax operations: form 030 and scanned supporting documents are filed through the Agencia Tributaria's electronic registry. The person who files it online must already have an NIF registered with the Agencia Tributaria and an electronic certificate, DNIe or Cl@ve, so in practice it is usually filed by a representative.

💡 Pro tip: Use exactly the same name order and spelling as in your passport on every form. A mismatch between the bank, the notary and the tax office is one of the most common causes of delays.

⚠️ Common mistake: Writing your passport number where a form asks for your NIF. If you have an NIE or an M-NIF, use it.

Using your NIF online with the tax office

Once you have a NIF, you can deal with the Agencia Tributaria online. For most services you identify yourself with Cl@ve, an electronic certificate or, for the income tax return, a reference number (número de referencia). According to the Agencia Tributaria, the check data it asks for depends on your document:

  • ✅ DNI: the document's validity date (or its issue date, for a permanent DNI).
  • ✅ NIE: the document's support number (número de soporte).
  • ✅ NIF beginning with K, L or M: your date of birth.

If you did not file an income tax return the year before, the Agencia Tributaria asks instead for the last five characters of the IBAN of a bank account it has on record as yours for the year.

💡 Pro tip: Keep a photo of your NIE document or TIE in a safe place. Online services ask for data printed on it, and you will need them when you are away from your files.

Keeping your details up to date

Your NIF does not change, but the data linked to it can.

  • ✅ New DNI or NIE: if you hold a K, L or M NIF and later obtain a DNI or NIE, the Agencia Tributaria says you must tell it, and anyone else who needs your NIF, within two months. Your old number stays valid until that notification.
  • ✅ New address or personal data: individuals who are not in business use modelo 030, the census form for registration, change of address and changes of personal data. The self-employed use their census return (modelo 036) instead.
  • ✅ Leaving Spain: updating your tax address is one of the administrative steps when you move away; see taxes in Spain for expats.

What "FTIN" means on foreign forms

Many expats meet the term on a US form, such as the W-8BEN. According to the IRS instructions for Form W-8BEN, line 6a asks for "the foreign tax identifying number (FTIN) issued to you by your jurisdiction of tax residence", and line 6b is for people not legally required to obtain one.

  • ✅ If Spain is your country of tax residence: the Spanish number is your NIF, which for a foreigner is your NIE (or your M-NIF).
  • ✅ If you are tax resident elsewhere: the form asks for that country's number, not a Spanish one.
  • ✅ Bank forms: banks also ask for your tax number for each country of tax residence, and the OECD publishes each country's format.

Which country is your tax residence is not always obvious in the year you move. See tax residency in Spain and check it with a qualified tax adviser before you sign a tax form.

👉 Planning your move on a Spain Digital Nomad Visa? Ask a MoveWise Client Manager about your eligibility — we cover the visa and the NIE; tax questions go to an independent adviser.

Common mistakes with tax numbers

  1. Requesting a separate NIF when you already have an NIE. For a foreigner, the NIE is the NIF.
  2. Writing your passport number in the NIF field. If you have an NIE or an M-NIF, use it.
  3. Spelling your name differently on each form. Use the order and spelling of your passport everywhere.
  4. Forgetting to notify a new NIE. Holders of an M-NIF have two months to tell the Agencia Tributaria and the people who hold the old number.
  5. Keeping an old address on file. Notices from the tax office go to your registered tax address, so update it with modelo 030 or 036.
  6. Giving a Spanish number as your FTIN when you are tax resident elsewhere. The FTIN is the number of your country of tax residence.

When you need a tax adviser

Getting the number is administrative; using it can involve tax choices. Speak to a qualified tax adviser if:

  • You are unsure which country you are tax resident in, or you are completing a foreign tax form.
  • You will be self-employed or set up a company in Spain.
  • You have income or assets in more than one country.
  • You are buying property in Spain.

For the wider picture, see taxes in Spain for expats.

Frequently asked questions

What is the difference between the NIF and the NIE?

The NIF is your tax identification number; the NIE is the identification number the Police assign to foreigners. For a foreigner who has an NIE, the NIE is also the NIF, so in practice it is the same number used for both purposes.

Is the DNI the same as the NIF?

Yes, for Spanish nationals. According to the Agencia Tributaria, Spanish nationals who must hold a DNI use it as their NIF. Forms that say "DNI/NIF" are asking for that number; foreigners write their NIE in the same field.

What does DNI/CIF mean on a Spanish form?

It asks for a tax identification number: the DNI if the person is a Spanish national, or the company's tax number (still often called CIF) if it is a business. As a foreign individual, you write your NIE, or your M-prefix NIF if you have one.

What is my foreign tax identifying number (FTIN) for Spain?

Forms such as the US W-8BEN ask for the tax number issued by your country of tax residence. If Spain is your country of tax residence, that is your Spanish NIF, which for a foreigner is the NIE. If you are not sure where you are tax resident, check with a qualified tax adviser before you sign the form.

Can I get a NIF in Spain without an NIE?

In certain cases. The Agencia Tributaria assigns an NIF beginning with M to foreigners without an NIE, on form 030, with a police document showing that you have applied for an NIE or that you are not required to have one. If you must have an NIE, the M-NIF is temporary.

How do I change my address with the Spanish tax office?

Individuals who are not in business use modelo 030, the census form for changes of address and personal data. The self-employed use their census return, modelo 036. Both are explained on the Agencia Tributaria website.

What is the número de soporte of an NIE?

It is the support number of the NIE document itself, not the NIE. The Agencia Tributaria asks for it, together with your NIE, when you identify yourself with a reference number for the income tax return. Holders of an NIF beginning with K, L or M give their date of birth instead.

Does Spain have a fiscal code?

Spain does not use the term "fiscal code". The closest equivalent is the NIF (Número de Identificación Fiscal), the tax identification number used for individuals and companies. For foreign individuals, the NIF is normally the NIE.

How MoveWise can help

MoveWise handles the immigration side of your move to Spain, including the identification numbers that come with it. Your Legal Manager:

We do not give tax advice, file tax returns or apply for tax regimes on your behalf. For tax questions, we can put you in touch with independent qualified tax advisers we work with.

Our support is modular: an eligibility assessment first (Module 1), then full preparation and submission (Module 2). If your application is refused, you receive a full refund of our fee, under the conditions of our service agreement. Clients have left more than 500 client reviews on Trustpilot.

👉 Book a free consultation with a MoveWise Client Manager — tell us about your plans, and we will explain the visa route and the registrations that follow.

Sources and legal references

  • Agencia Tributaria: NIF for individuals (K, L and M numbers, form 030, validity, €150 penalty)
  • Agencia Tributaria: remote NIF request for individuals without DNI/NIE (form 030)
  • Agencia Tributaria: identification with a reference number (DNI validity date, NIE support number, K/L/M date of birth)
  • Agencia Tributaria: modelo 030, census registration, change of address and personal data for individuals
  • Agencia Tributaria: census registration and NIF for entities (modelo 036)
  • Policía Nacional: assignment of the NIE
  • one.gob.es: application for an NIE
  • OECD: Spain, tax identification numbers
  • IRS: Instructions for Form W-8BEN (Rev. October 2021)

This article is general information about Spanish tax identification rules, verified on 6 November 2026. It is not tax, legal or financial advice and does not take your personal situation into account. Tax law and its interpretation change often. Always confirm your position with a qualified tax adviser before acting.

 

Contáctenos

While the requirements for obtaining a visa for Spain are straightforward, preparing the necessary documents and navigating the application process can be challenging. Mistakes or incomplete paperwork could put your application at risk.

If you have any doubts or questions about the process, you can book a free consultation for the following visa types, we’ll be there to help you every step of the way:

Digital Nomad Visa Spain -> BOOK TODAY a 100% Free Consultation

Non Lucrative Visa Spain -> BOOK TODAY a 100% Free Consultation

Student Visa Spain -> BOOK TODAY a 100% Free Consultation

Hasta pronto!


Spain Non-Lucrative Visa Denied? Why It Happens and What to Do Next (2027)
Spain Digital Nomad Visa Without a Degree: How to Prove 3 Years of Experience (2027)
Italy Digital Nomad Visa for Freelancers and Business Owners: 4 Set-ups That Work (2027)

Más publicaciones

Spain Non-Lucrative Visa Denied? Why It Happens and What to Do Next (2027)
Spain Digital Nomad Visa Without a Degree: How to Prove 3 Years of Experience (2027)
Italy Digital Nomad Visa for Freelancers and Business Owners: 4 Set-ups That Work (2027)