Skip to content

Company CIF in Spain: what it is, its format, and how to check it

A company CIF is the former name for its NIF: legislation in force since 1 January 2008 refers only to the tax identification number. It has a legal form letter, seven digits, and a check character.

By Albert SalguedaReviewed by Equipo Melso, Revisión editorialPublished 10 min read
Illustration of an office desk with a paper invoice, a magnifying glass over the tax identification number, and a document folder in the background.

In short

  • The CIF was the tax identification code for legal persons and entities: Decree 2423/1975 was repealed by Royal Decree 1065/2007, in force since 1 January 2008.
  • The NIF of a legal person or entity has nine characters: a legal form letter, seven digits and a control character.
  • In Spanish entities, the letter B identifies limited liability companies and A identifies public limited companies; there are codes for cooperatives, associations or communities of property (comunidades de bienes), among others.
  • The NIF of a legal person does not change unless its legal form or its nationality changes.
  • An individual autónomo (self-employed worker) does not have a separate NIF for their activity: if they have Spanish nationality, it is their DNI number with its verification letter.

A company's CIF, in brief

A company's CIF is that company's NIF: the tax identification code regulated by Decree 2423/1975 was repealed by Royal Decree 1065/2007, in force since 1 January 2008, which regulates the tax identification number of legal persons and entities. "CIF" is still used in everyday language to refer to a company's NIF.

What a company's CIF is and why people talk about NIF today

The CIF (tax identification code) was the code used to identify legal persons and entities in general. It was regulated by Decree 2423/1975. That decree was repealed by Royal Decree 1065/2007, which entered into force on 1 January 2008 and regulates the tax identification number of legal persons and entities, according to its sole repealing provision.

Today the regulation speaks only of NIF (tax identification number). "CIF" continues to be used in everyday language to refer to a company's NIF. When someone asks for "the company's CIF", they are asking for that NIF.

The CIF identified legal persons and entities and was regulated by Decree 2423/1975, now repealed. The NIF identifies natural persons, legal persons and entities without legal personality and is regulated by Royal Decree 1065/2007, currently in force.(opens the image in a new tab)
CIF and NIF, side by side

The NIF is not exclusive to companies. Natural persons, legal persons and entities without legal personality have a NIF for their tax-relevant relations, as stated in Article 18.1 of Royal Decree 1065/2007.

Important

The CIF is not a different number from the NIF. It is the name people still use for the same identifier: if an invoice, a contract or a form asks for a company's CIF, you have to provide its NIF.

What a company's NIF looks like: letter, seven digits and control character

The NIF of a legal person or entity has nine characters, according to Article 2 of Order EHA/451/2008. The structure is divided into three parts: a letter, a seven-digit number and a control character. The sum of the three gives 1 + 7 + 1 = 9 characters.

The letter is not random: it indicates the legal form if it is a Spanish entity (or the status of a foreign entity or permanent establishment of a non-resident entity). The seven digits are random in numbers assigned under this order, in force since 1 July 2008. A client may retain a NIF formed under the previous system. The control character completes the sequence; we do not explain how it is calculated here.

What each letter of a company's NIF means

In Spanish entities, the first character of the NIF indicates its legal form. The codes are set out in Article 3 of Order EHA/451/2008.

LetterLegal form in Spanish entities
APublic limited companies
BLimited liability companies
CGeneral partnerships
DLimited partnerships
ECommunities of property (comunidades de bienes), undivided estates and other entities without legal personality not included in other codes
FCooperatives
GAssociations
HHomeowners' associations
JCivil companies (sociedades civiles)
PLocal corporations
QPublic bodies
RReligious congregations and institutions
SBodies of the State Administration and the autonomous communities
UTemporary joint ventures
VOther undefined types

A NIF starting with B corresponds to a limited liability company; one starting with A, to a public limited company. Foreign entities and permanent establishments of non-resident entities have other codes, which we do not detail here. If you are hesitating between working for yourself or setting up a limited company (letter B), you can read autónomo or limited company.

The codes P, Q, R and S do not identify commercial companies: they correspond to local corporations, public bodies, religious congregations and institutions, and bodies of the State Administration and autonomous communities.

Code E deserves a separate mention. It groups communities of property (comunidades de bienes), undivided estates and other entities without legal personality that are not included in another code. That is, entities that are not companies, but which also have a NIF for their tax-relevant relations.

How a company gets its NIF: provisional and permanent

Legal persons and entities that are going to carry out business or professional activities must apply for a NIF before any delivery, supply or acquisition of goods or services, collection, payment or hiring of staff for their activity. And, in any case, within the month following their incorporation (Article 23 of Royal Decree 1065/2007).

The steps, in order

  1. Application. The company submits a single application for a NIF before carrying out any of those transactions and, in any case, within the month following its incorporation.

  2. Provisional NIF. The NIF is provisional as long as the entity does not provide a copy of the notarial deed (escritura) or authentic document of incorporation and the bylaws, and the certificate of its registration in a public registry when applicable (Article 24.2 of Royal Decree 1065/2007).

  3. Pending documentation and permanent NIF. With a provisional NIF, the entity must submit the pending documentation within one month of registration in the relevant public registry. The permanent NIF is requested with a census amendment declaration (Articles 24.3 and 24.4 of Royal Decree 1065/2007).

How Melso helps

If you are going to set up an S.L. (Spanish limited company), on the incorporate an S.L. page you have the steps and Melso's service.

The number does not change, its status changes

Provisional and permanent are not two different numbers: it is the same NIF in two different situations. What changes is its status, not the characters that make it up.

Nor does it change for other reasons. The NIF of a legal person is invariable whatever changes it undergoes (Article 22.1 of Royal Decree 1065/2007). The exception is a change of legal form or nationality. Changing partners or the company name does not alter the number.

If you are considering creating one, in limited company we review what it is and how it works.

The NIF-IVA: the same number with ES in front

For intra-Community transactions there is the NIF for VAT purposes, known as NIF-IVA. According to Article 25 of Royal Decree 1065/2007, it is the NIF with the prefix ES. It is not a different number: the company's letter and digits remain, and the prefix ES is placed in front.

The NIF-IVA is assigned when inclusion in the Register of intra-Community operators is requested. The application starts the process: it is the tax authority that assigns it following that application, it is not obtained merely by requesting it.

The prefix ES identifies the Spanish NIF-IVA. This number does not change the general identification of the company: it adds the country prefix when it comes to intra-Community transactions. You can also read VAT number Spain.

Where to see a company's NIF and how to check it before invoicing

The NIF is proven with the document issued by the tax administration for its record, according to Article 18.2 of Royal Decree 1065/2007. That document is what you can ask a new client for to verify the number before issuing the invoice.

On a full invoice, the NIF of the issuer is mandatory and, in the cases of Article 6.1.d (for example, when the invoice issuer is established in Spain and the transaction is located here), also that of the recipient, according to Article 6 of the Invoicing Regulations. Simplified invoices are governed by Article 7. Regarding the rest of the document's content, you can read how to make an invoice.

How to check the NIF a client gives you

Four steps to check a company's NIF: ask for the supporting document, count the nine characters, check that the first letter corresponds to its legal form if it is a Spanish entity, and check the seven digits and the control character.(opens the image in a new tab)
How to check a company's NIF in four steps

Asking for the document is not enough: check that the data match. The number must have nine characters, with a letter indicating the legal form if it is a Spanish entity, seven digits and a control character, according to Articles 2 and 3 of Order EHA/451/2008.

To perform that check, you can use the NIF validator, although the reference remains the supporting document issued by the tax administration.

If what you are going to send before the invoice is a document with prices and terms, see proforma invoice: what it is and what value it has.

And if you are an autónomo: your NIF is that of your DNI or NIE

An autónomo does not have a separate NIF for their activity. For natural persons with Spanish nationality, the NIF is the DNI number followed by the verification letter; for natural persons without Spanish nationality, it is, generally, the foreigner identity number, NIE (Articles 19 and 20 of Royal Decree 1065/2007).

On your invoices, that NIF appears as the issuer and, in the cases of Article 6.1.d, also that of the recipient. You have more on both documents in NIF and DNI: is it the same?.

When registering as an autónomo you do not receive a new number; what you do choose is the heading for your activity, which we explain in IAE headings.

Example: a broken-down NIF and the invoice that carries it

The fictional NIF B12345678 follows the composition in Article 2 of Order EHA/451/2008: one letter, seven digits and a control character. The B corresponds to a limited liability company. The seven digits are 1234567. The 8 is the control character, fictional in this example; we do not explain how it is calculated. The total is 1 + 7 + 1 = 9 characters.

A professional female autónoma invoices that S.L. The invoice carries the NIF of both parties: that of the autónoma, which is that of her DNI with its letter (Article 19 of Royal Decree 1065/2007), and that of the company, B12345678. Article 6.1.d of the Invoicing Regulations requires the NIF of the person issuing the invoice and, when the issuer is established in Spain and the transaction is located here, also that of the recipient. That situation explains why the invoice in the example carries both NIFs.

Example

Invoice from a professional autónoma to S.L. B12345678: Taxable base: €2,000. IVA (Spanish VAT) at 21%: 2,000 × 21% = €420. Withholding at 15%: 2,000 × 15% = €300. Total: 2,000 + 420 - 300 = €2,120.

Base of 2,000 euros, plus 420 euros of VAT at 21%, minus 300 euros of withholding at 15%: total of 2,120 euros.(opens the image in a new tab)
Illustrative example with fictional figures.

Common mistakes when using a company's CIF

Treating the CIF as a different number from the NIF

The CIF was the tax identification code for legal persons and entities regulated by Decree 2423/1975, repealed by Royal Decree 1065/2007, in force since 1 January 2008. Today the regulation speaks only of NIF and "CIF" is used in everyday language. For a natural person with Spanish nationality, the NIF is their DNI number with its letter (NIF and DNI: is it the same?).

Believing that the NIF changes if partners or company name change

Article 22.1 of Royal Decree 1065/2007 establishes that the NIF of a legal person is invariable whatever changes it undergoes. The exception is a change of legal form or nationality.

Thinking that the provisional and permanent NIF are different numbers

The NIF is provisional as long as the entity does not provide a copy of the notarial deed or authentic document of incorporation and the bylaws, and the certificate of its registration in a public registry when applicable, according to Article 24.2 of Royal Decree 1065/2007. The number is the same: what changes is its status.

Issuing the invoice without the recipient's NIF

On a full invoice, the NIF of the issuer is mandatory and, in the cases of Article 6.1.d, also that of the recipient, according to Article 6 of the Invoicing Regulations. For the rest of the mandatory content, you can read how to make an invoice.

How Melso helps

Melso is your online gestoría (a private firm that handles tax and administrative paperwork), with an AI agent and human professionals behind it, and day-to-day communication takes place via WhatsApp, Telegram, email and web.

It includes your autónomo registration, your invoices with VERI*FACTU and the quarterly tax returns for your profile (modelos 303 and 130, among others) and Renta (annual income tax return, modelo 100), with a professional reviewing every return.

The Melso Pro plan costs €49 a month or €490 a year, with no lock-in, and Melso's errors in an included return filed by Melso are covered up to €30,000 a year in surcharges (recargos), penalties and late-payment interest, without covering the tax itself.

The next step is to review the plan and get started at Melso Pro for autónomos.

This article is for information only and does not replace professional advice for your case. Last reviewed: 24 November 2026.

Sources

  1. Royal Decree 1065/2007, Article 18 (obligation to hold a NIF), BOE (accessed )
  2. Royal Decree 1065/2007, sole repealing provision and third final provision, BOE (accessed )
  3. Order EHA/451/2008, Article 2 (composition of the NIF of legal persons and entities), BOE (accessed )
  4. Order EHA/451/2008, composition of the NIF of legal persons and entities (Articles 2 and 3), BOE (accessed )
  5. Royal Decree 1065/2007, Article 22 (NIF of legal persons and entities), BOE (accessed )
  6. Royal Decree 1065/2007, Article 23 (application for the NIF of legal persons), BOE (accessed )
  7. Royal Decree 1065/2007, Article 24 (assignment of the NIF: provisional and definitive), BOE (accessed )
  8. Royal Decree 1065/2007, Article 25 (NIF for VAT purposes), BOE (accessed )
  9. Invoicing Regulations, Article 6 (invoice content), BOE (accessed )
  10. Royal Decree 1065/2007, Articles 19 and 20 (NIF of individuals), BOE (accessed )
Back to top

Frequently asked questions. What people ask us most.

Today the legislation refers only to the NIF. The CIF (código de identificación fiscal) was the code regulated by Decree 2423/1975 for legal persons and entities. That decree was repealed by Royal Decree 1065/2007, in force since 1 January 2008, which regulates the tax identification number (NIF) of legal persons and entities. 'CIF' continues to be used in everyday language for a company's NIF.

Less paperwork.
More time for you.

Start with Melso or tell us about your case on WhatsApp.

Chat on WhatsApp (opens in a new tab)
  • No lock-in
  • Real professionals
  • Mistakes covered