CIF and NIF in Spain: What They Are and Which Number You Need

CIF and NIF in Spain

Table of contents:

The CIF stopped existing on January 1, 2008. Since that day, companies, associations, and every other entity have had an NIF, exactly like individuals do. If a client, a bank, or a form asks you for “the company’s CIF,” what they’re asking for is its NIF.

The confusion isn’t unfounded, though. What changes depending on who you are isn’t the name of the number, but how it’s built, who issues it, and how you get it. A Spaniard with a DNI, a foreigner with a NIE, a foreigner without one, a Spanish company, a foreign company, and a permanent establishment follow six different paths, and only one of them is automatic.

In this guide you’ll see what each term meant and which rule ended the CIF. Then, which number applies to you, what each letter of a company’s NIF means, how to apply for it and within what deadlines, and what happens when the number on an invoice isn’t the right one.

Do you want a expert consultation? Contact us and we will help you.

In 30 Seconds

  • The CIF disappeared on January 1, 2008, when Royal Decree 1065/2007 took effect. Spanish law now recognizes only the NIF, for people and entities alike.
  • A Spaniard’s NIF is their DNI number plus its check letter; a foreigner’s is their NIE. Anyone with neither gets an NIF from the Spanish Tax Agency starting with K, L, or M.
  • An entity’s NIF has nine characters beginning with a letter tied to its legal form: A for a corporation, B for a limited liability company, G for an association. Foreign entities start with N, and permanent establishments with W.
  • You apply using Form 036 when a business activity or an entity is involved, and Form 030 if you’re an individual with no DNI or NIE.

What the NIF Is and What the CIF Was

The NIF (Número de Identificación Fiscal, or Tax Identification Number) is the code the Spanish tax authorities use to identify anyone with tax-relevant dealings in Spain. Individuals have one, legal entities have one, and so do entities without legal personality, such as jointly owned property or an undistributed estate. The CIF (Código de Identificación Fiscal) was its predecessor for companies and entities, and it no longer exists as a separate category.

When both coexisted, the split was clean: the CIF identified legal entities under Decree 2423/1975, and the NIF identified individuals under Royal Decree 338/1990. Both rules have been repealed. That’s the whole difference between CIF and NIF today: a historical one, not a practical one.

Two terms worth pinning down, since they come up constantly. A legal entity is the company or organization itself (a limited liability company, a cooperative, an association), separate from its shareholders. An entity without legal personality operates in business without being a company, such as a homeowners’ association. Both need an NIF.

CIF and NIF: What Changed in 2008 and Why People Still Say CIF

The change has a date and a rule behind it. Royal Decree 1065/2007 took effect on January 1, 2008, and expressly repealed Decree 2423/1975, which governed the identification code for legal entities, and Royal Decree 338/1990, which governed how the NIF was built. Since then, there’s been a single number for everyone.

One nuance worth knowing early, because it explains why some sources say January and others say July: both dates are correct and they don’t refer to the same thing. The CIF disappeared on January 1, 2008 under Royal Decree 1065/2007. The current structure of an entity’s NIF, with its letters, has applied since July 1, 2008, when Order EHA/451/2008 came into force.

So why does everyone still say CIF? Habit, mostly, plus the fact that the term is baked into invoicing software, contract templates, and forms nobody has revisited. In practice, “CIF” now works as a nickname for a company’s NIF. Nothing more.

Which Number Applies to You

This is the question almost nobody answers, and the one that actually matters. The name is the same for everyone, but the number you get and who issues it change with your situation.

Who you are Your NIF Who issues it and how to apply
Spanish national with a DNI Your DNI number plus its check letter Ministry of the Interior. Nothing else to request
Spanish national under 14 living in Spain, no DNI NIF starting with K Spanish Tax Agency, Form 030
Spanish national living abroad, no DNI NIF starting with L Spanish Tax Agency or a consulate, Form 030
Foreign national with a NIE Your NIE itself Ministry of the Interior. Your NIE already is your NIF
Foreign national without a NIE NIF starting with M Spanish Tax Agency or a consulate, Form 030
Self-employed worker, Spanish or foreign The same DNI or NIE you already hold No new number: you register with the tax census using Form 036
Spanish company or entity Nine characters, led by its legal-form letter Spanish Tax Agency, Form 036
Foreign company or entity NIF starting with N Spanish Tax Agency, Form 036
Permanent establishment of a nonresident entity NIF starting with W Spanish Tax Agency, Form 036, one per establishment

One nuance about the letter M causes a lot of confusion. According to the Spanish Tax Agency, an M number is permanent for foreign nationals who aren’t required to hold a NIE, such as a nonresident signing a one-off transaction in Spain. It’s temporary for those who are required to hold one, lasting only until the Ministry of the Interior issues it. If that’s your case, it helps to know how to obtain a NIE in Spain and why nonresidents are asked for a NIE too.

And watch out for a detail that comes up in nearly every conversation: a self-employed worker has no CIF, and no separate number either. Their NIF is their DNI or NIE. What changes when they register isn’t the number but the obligations they take on, which we cover in our guide to the obligations of self-employed workers in Spain.

The Letters of a Company’s NIF, One by One

An entity’s NIF has nine characters: a letter indicating its legal form, a random seven-digit number, and a check character. Since Order EHA/451/2008 took effect, the number no longer reveals anything about the province of the registered office, as the old CIF did.

Letter What it identifies
ACorporations (sociedades anónimas)
BLimited liability companies (sociedades limitadas)
CGeneral partnerships
DLimited partnerships
EJointly owned property, undistributed estates, and other entities without legal personality
FCooperatives
GAssociations
HHomeowners’ associations under horizontal property rules
JCivil partnerships
NForeign entities
PLocal authorities
QPublic bodies
RReligious congregations and institutions
SState and regional government bodies
UTemporary business consortiums (UTEs)
VOther types not covered by the remaining letters
WPermanent establishments of nonresident entities in Spain

In practical terms: the letter tells you what kind of counterparty you’re dealing with before you read a single document. If a supplier sends you a number starting with N, you’re contracting with a foreign entity, and the tax treatment of that transaction isn’t the same. That number, by the way, never changes unless the entity changes its legal form or its nationality.

How to Apply for an NIF and the Deadlines That Apply

For a company, the process happens in two stages: first a provisional NIF, then the permanent one. The number itself is the same; what changes is its status.

  1. File Form 036 before starting any activity or tax-relevant transaction, along with the deed of incorporation and the bylaws. If documents are missing, the NIF issued is provisional.
  2. Submit what’s still outstanding within one month of registration with the relevant registry, or from the date of the deed when no registration is required.
  3. Request the permanent NIF with an amending census return, Form 036 again, attaching the missing documents.
  4. Don’t let the clock run out. Once that deadline passes, or six months from the provisional NIF without the paperwork, the Spanish Tax Agency can formally request it and give you a maximum of ten days. Ignore that request and the provisional NIF can end up revoked.

If you’re an individual with no DNI or NIE, your process is different and shorter: Form 030. You file it with the Spanish Tax Agency or, if you’re outside Spain, at a consulate, with your passport and documents proving your situation.

One note that saves time: Form 037, the simplified census return, was abolished by Order HAC/1526/2024. Every registration, amendment, and deregistration now goes through Form 036 at the Spanish Tax Agency, even though plenty of guides and templates still mention 037. The full picture is in our guide on how to create a company in Spain.

Do you want a expert consultation? Contact us and we will help you.

Foreign Companies and Permanent Establishments: The NIF You Need to Operate in Spain

This is where generic guides fall short and where files get stuck most often. A foreign company needs a Spanish NIF as soon as it’s going to have tax-relevant dealings in Spain, even without opening an office or hiring anyone. The typical cases: setting up a subsidiary, becoming a shareholder in a Spanish company, buying real estate, receiving income, or invoicing Spanish clients.

That NIF is issued by the Spanish Tax Agency through Form 036, and it starts with the letter N. The entity itself applies through whoever represents it, and you want this settled before signing anything before a notary, not after.

If the nonresident entity operates in Spain through one or more permanent establishments with clearly distinct activities and separate management, each one must apply for its own NIF, different from the parent’s. That number starts with W. It’s a rule that catches many groups off guard: the parent may already hold its N and still need an additional W. We break this down in our analysis of what counts as a permanent establishment in Spain and when comparing a representative office, branch, or subsidiary.

The cost nobody budgets for is documentary. The entity’s incorporation papers and proof of its representative’s authority come from the home country, which means sworn translation and, depending on the country, an apostille. That prep work decides whether the NIF takes weeks or months. It’s the part we handle within our business immigration service, alongside what we explain about setting up a company in Spain from abroad.

VAT Number: When Your NIF Isn’t Enough to Invoice Within the EU

Holding an NIF identifies you before the tax authorities, but it doesn’t clear you to invoice a company in another EU country without VAT. That takes one more step: registering with the Register of Intra-Community Operators (ROI), requested on Form 036 by checking box 582 and entering the expected date of your first transaction in box 584.

The number you get, the NIF-IVA or intra-Community VAT number, is your same NIF with the prefix ES in front. Once it’s issued, you appear in the European VIES database, where any client can verify it. Watch the calendar, too: if the Spanish Tax Agency doesn’t decide within three months, the application may be deemed denied.

An example with numbers. A Spanish limited liability company invoices 4,000 euros in services to a German business. With both parties listed in VIES, the invoice goes out without VAT and the client accounts for the tax in its own country. Without that registration, the German company can refuse the invoice until the number shows up in the system, leaving payment on hold and a corrective invoice to issue. Your annual filings don’t change because of this, but the order does: registration first, first invoice second.

Costly Mistakes With the CIF and the NIF

  • Getting stuck on the provisional NIF. It’s the most common slip when incorporating a company. The deed is signed, the provisional number comes through, and nobody goes back to Form 036 after registration. The result is a formal request and, at worst, a revoked number.
  • Not reporting your new number. If you held an M number and then obtained your NIE, or held an L and obtained your DNI, you have two months to report it to the tax authorities and to anyone who needs it on record. The previous NIF stays valid only until the date you report the change.
  • Mixing up the NIF and the VAT number. They’re the same digits, but they don’t do the same job. Invoicing an EU client without VAT while not registered in the ROI is the fastest route to a corrective invoice.
  • Asking for “the CIF” on your own forms. If your website or contract only has a CIF field, you’re leaving out self-employed workers and individuals, who also have an NIF. It’s a small thing that creates daily friction, and a good one to fix when you review mandatory e-invoicing.
  • Taking a number at face value. Any European operator’s VAT number can be checked in VIES, and the Spanish Tax Agency’s e-portal offers a third-party NIF verification service for users with a digital certificate. Before contracting with an entity you don’t know, it’s a minute well spent.

And one clarification that prevents trouble: the Spanish Tax Agency notes that failing to use your NIF in tax-relevant transactions is treated as a minor offense, carrying a fine of 150 euros. It won’t ruin anyone, but it signals that the wrong number carries consequences of its own, on top of whatever the transaction itself triggers.

Knowing the CIF no longer exists solves half the question. The other half is holding the right number, issued and active, before you sign the deed, send the first invoice, or open the bank account. And that depends on who you are and what you plan to do in Spain.

At ILLAY Legal we handle the full census registration: the NIF for a Spanish company, for a foreign entity, for a permanent establishment, and the ROI registration when EU transactions are involved. All of it 100% online and in your language. Tell us what you plan to do in Spain, through which entity, and which document identifies you, and we’ll tell you which number you need, who has to apply for it, and what paperwork to prepare. You can start with our company incorporation in Spain service or reach out directly to ILLAY Legal.

Keep reading: how to start a business in Spain as a foreigner · tax residency in Spain

Frequently Asked Questions About the CIF and the NIF

What Is My NIF and Where Do I Find It?

It depends on your document. If you’re a Spanish national, it’s your DNI number followed by its letter, printed on the card itself. If you’re a foreign national, it’s your NIE, which appears on your TIE (Foreigner Identity Card) or on the certificate that assigned the number. For a company, it’s the nine-character number in its deed of incorporation, on its tax identification card, and on any census certificate from the Spanish Tax Agency. If you hold none of those, you don’t have an NIF yet and you’ll need to apply.

Does a Homeowners’ Association Have a CIF or an NIF?

An NIF, like everyone else. Homeowners’ associations under horizontal property rules are entities without legal personality, and their NIF starts with the letter H, a dedicated code under Order EHA/451/2008. They need it to open the association’s bank account, sign service contracts, and apply withholdings where required. Jointly owned property and undistributed estates, by contrast, carry the letter E.

I Have an M Number and Just Received My NIE. Do I Need to Tell the Tax Agency?

Yes, and there’s a deadline: two months from the date you obtain it. You have to report it to the tax authorities and to any person or entity that needs your new number on file, such as your bank, your accountant, or your clients. The previous NIF remains valid only until the date you report the change, so the sooner you do it, the fewer documents will be left carrying the old number. The same applies if you held an L number and obtained a DNI.

Does a Self-Employed Worker Have a CIF?

No. A self-employed worker is an individual, so their tax number is their DNI or NIE, with no additional code. Registering as self-employed doesn’t generate a new number: it adds you to the census of business owners, professionals, and withholding agents, with the obligations that come with it. If someone asks for “the CIF of your business,” what they need is the NIF you already have.

How Do You Say CIF or NIF in English?

There’s no official translation, which is exactly why it’s worth explaining. In practice, NIF is rendered as tax identification number, often with the Spanish acronym in parentheses to avoid confusion. On international forms asking for the TIN (Taxpayer Identification Number) of a Spanish resident, the NIF is the correct entry. As for the CIF, the cleanest answer is that it was the old code for companies and has been replaced by the NIF.

Can I Check a Company’s NIF Before Working With It?

Yes, and it’s worth doing when you don’t know the counterparty. For intra-Community transactions, the VAT number is verified through the European Commission’s VIES system. For a Spanish NIF, the Spanish Tax Agency’s e-portal offers a third-party verification service that requires a digital certificate. And if you want to know who stands behind the company, who manages it, and whether its filings are current, that information comes from the Commercial Registry.

Do you want a expert consultation? Contact us and we will help you.

Legal notice: This article is for informational purposes only and may contain errors or be outdated. It does not constitute legal advice. For an updated initial consultation, contact us. One of our expert attorneys will assist you.

Share this article:

Our Team

Meet the team

At ILLAY Legal, we are a diverse and passionate team of more than 20 professionals from 15 different countries. We believe that cultural and linguistic diversity is one of our greatest strengths, which is why we serve our clients in more than 10 languages, including Spanish, English, French, Brazilian Portuguese, Russian, Albanian, Turkish, Moroccan Arabic, Chinese, Serbian, Italian, Finnish, and Polish.

We work from our offices in Barcelona and Madrid, united by a common purpose: to offer personalized, professional service tailored to each person’s needs. More than just a legal team, we are a group of people committed to accompanying and guiding our clients with empathy, knowledge, and dedication.

Our numbers speak for themselves

Our track record

On average, we tell good news about their immigration cases to 9-10 people each day. A real perk of the job.

Refusals overrulled in appeals

+ 0

Immigration cases solved and in process

+ 0

Appeals efficiency

0 %

Join a Community of Satisfied Customers

Posted on Google Google
Givago Dias Mendes profile picture
Givago Dias Mendes
27/03/2026
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
Muy educado, eficientes, organizados. También rápidos. Mejor experiencia posible!
Posted on Google Google
Anastasia Danilova profile picture
Anastasia Danilova
26/03/2026
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
I would like to sincerely thank Marc and Soundous for all the support they gave me and my mom in obtaining our residence. You are an amazing team, and I feel very lucky to have found your company to guide us through this process.
Posted on Google Google
Camryn Jones profile picture
Camryn Jones
25/03/2026
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
I had an amazing experience working with Dario and his team throughout my visa process. They made everything completely stress-free and were incredibly helpful every step of the way. Dario speaks excellent English, which made communication easy and comfortable, and he was always responsive, patient, and clear in explaining everything. He and his colleagues handled every detail with care, efficiency, and in a very timely manner, which gave me a lot of confidence and truly made my life so much easier throughout the entire process. By far the best lawyer I’ve worked with in Barcelona. I couldn’t have asked for a better experience and would highly recommend Dario and his team to anyone needing help with visas or immigration.
Posted on Google Google
Marc Ovalle profile picture
Marc Ovalle
22/03/2026
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
We have been working with Marc and his team and the experience has been truly remarkable! From day one, their professionalism has been outstanding. The depth and breadth of knowledge across the entire team have consistently impressed us and given us complete confidence in our partnership. They are reliable, insightful, and truly committed. Thank you Marc!
Posted on Google Google
Karen Oelrich profile picture
Karen Oelrich
20/03/2026
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
He tenido una muy buena experiencia, nos ayudaron en la resolución de dudas y consultas desde el primer contacto. El proceso fue muy rápido, claro y expedito.
Posted on Google Google
Abs Ka profile picture
Abs Ka
19/03/2026
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
A friend recommended Illay Legal to help obtain my permanent residency in Spain. Exceptional service! Marc explained every part of the process clearly and precisely. Once I provided all the necessary details, the team did all the work: pre-completed the necessary paperwork, helped retrieve padron and digital tax certificate, secured appointments in my preferred neighbourhood and checked in with me before and after both appointments. I subsequently switched both my tax and business accountancy contracts to Marc's firm and have enjoyed the same very high level of service. Communication via email and WhatsApp, and extremely responsive to answering any small or large questions/concerns. A huge endorsement to the whole team - I would highly reccomend. Regards Ismail
Posted on Google Google
Dean profile picture
Dean
11/03/2026
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
Awesome service, got my permanent residency quickly and without any issues
Posted on Google Google
Anastasiia Sizova profile picture
Anastasiia Sizova
10/03/2026
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
Lawyers I truly trust and genuinely enjoy working with. Huge thanks to Marc and Soundous for guiding me through a very stressful documentation process over the past few years. Together we managed to resolve a complicated situation I ended up in because of a bureaucratic issue with my previous paperwork. They have well-organized processes and a lot of experience with different kinds of cases — even the tricky ones. Whenever I was stressed or freaking out, they were always there to reassure and support me. That human approach means a lot. With them, you are in very good hands 💚
Posted on Google Google
MRI. Emran profile picture
MRI. Emran
10/03/2026
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
ILLAY Legal handled my immigration case in Spain very professionally and completed it on time. Highly recommended!
Posted on Google Google
Adriana Garzon profile picture
Adriana Garzon
09/03/2026
Google star 1Google star 2Google star 3Google star 4Google star 5Trustindex verifies that the original source of the review is Google.
Excelente asesoría y muy oportunos los tiempos. El acompañamiento en todo el proceso es de gran calidad.
Verified by Trustindex
Trustindex verified badge is the Universal Symbol of Trust. Only the greatest companies can get the verified badge who has a review score above 4.5, based on customer reviews over the past 12 months. Read more

The journey to a new life in Spain begins today