NIF, NIE, DNI, CIF: Understanding Identification Numbers in Spain
The complete guide to understanding the differences between NIF, NIE, DNI, and CIF in Spain. Essential for your administrative and tax procedures.

International Mobility Expert

In Spain, several acronyms refer to essential identification numbers for administrative, tax, and economic procedures. Each has its function and audience: the DNI for Spanish citizens, the NIE for foreigners, the NIF for the tax identification of individuals, and the CIF (now obsolete) for companies. This practical guide (2025 edition) explains what each of these numbers is for, their format, and the steps to obtain them.

The DNI: ID Card for Spaniards
The Documento Nacional de Identidad (DNI) is the national identity card for Spanish citizens. Issued by the General Directorate of the Police(Ministry of the Interior), it is an official and personal document that certifies the identity, personal data, and nationality of its holder. The DNI is the Spanish national identity card, equivalent to the French national identity card, and it plays a central role in identifying citizens in Spain. The DNI is exactly the same size as the French national identity card and includes a personal code composed of eight digits followed by a letter (e.g., 12345678A), this code consisting of numbers and letters.
Possession is mandatory in Spain for all citizens aged 14 and over. The Ministry of the Interior confirms that "all Spaniards are entitled to the DNI; it is mandatory for those over 14 residing in Spain". Young Spaniards can even obtain it voluntarily from birth (registration in the civil registry). The DNI contains personal information such as first name, last name, date of birth, address, and other data essential for identification. It is the main identity document in Spain. The DNI allows not only in-person identification but also electronic signatures and authentications (DNIe) for online procedures.

The NIE: Identification Number for Foreigners
The NIE (Número de Identidad de Extranjero) is the unique and exclusive personal number assigned to foreigners engaged in an activity in Spain. Spanish consulates explain that the NIE is reserved "for foreigners who, for economic, professional, or social reasons, are connected with Spain". In concrete terms, any foreigner (EU or non-EU) wishing to reside, work, study, or invest in Spain must obtain a NIE. This number is required to buy or rent a property, sign an employment contract, open a bank account, register for Social Security, etc. In short, without a NIE, it is impossible to carry out most administrative and economic procedures in Spain.
The format of the NIE is similar to that of the DNI but starts with a special letter. It has 9 characters: an initial letter (X, Y, or Z), followed by seven digits, and finally a control letter. For example, a NIE could be X1234567B. This number is valid for life and remains the same as long as the person carries out procedures in Spain. In practice, a foreigner's NIE also serves as their tax number (NIF) in Spain. As a specialized guide summarizes, "The NIE number is used both to identify a person physically (NIE) and fiscally (NIF)".
Unlike a passport or an identity card, the NIE is not a document in the visual sense (it has no photo): it is a number that appears on official documents (administrative communications, forms, notarial acts, etc.) and is required in all dealings with the authorities. In fact, a European citizen on a short visit (< 3 months) does not need a NIE: their national identity card is sufficient. The NIE must be applied for either in Spain (at a police station or an extranjería office) or at the Spanish consulate in their country of residence.

Besoin d'aide pour obtenir votre NIE blanc en Espagne ?
Notre équipe d'experts vous accompagne pour obtenir votre NIE blanc (non-résident) sans vous déplacer.
Plus de 300 NIE blancs obtenus
"Julia est super efficace : NIE obtenu en quelques jours."
Marie
Espagne
The NIF: Tax Identification Number
The NIF (Número de Identificación Fiscal) is the tax identification number used for tax returns and economic transactions in Spain with the Agencia Tributaria. Its function depends on the person's status:
- For natural persons: the NIF coincides with either the DNI (for a Spaniard) or the NIE (for a foreigner). In other words, every individual has a 9-character NIF: for a Spaniard, it's the 8 digits of the DNI followed by the control letter; for a foreigner, it's the full NIE (letter X/Y/Z + 7 digits + letter). As La Moncloa specifies, "For a natural person, their [NIF] number coincides with the DNI or NIE". In tax and administrative forms, this NIF is used (usually the same number as the already-held DNI/NIE). For example, a French citizen with a NIE Y1234567Z will use this same code as their NIF when paying taxes in Spain.
- For companies and legal persons: each company (SA, SL, association, etc.) receives a specific NIF upon registration. This is the modernized old CIF (Código de Identificación Fiscal). A company's NIF consists of a letter (indicating the type of company) followed by seven digits and a control character (letter or digit). For example, a typical limited liability company (S.L.) has a NIF like B12345678, where "B" designates the type (S.L.). Although the term "CIF" has not been official since 2008, it is still commonly used to refer to this company tax number.
In summary, the NIF is a universal tax number: for individuals, it is simply their DNI or NIE; for companies, it is the old CIF which has the same structure (letter + 7 digits + 1 control character). It is used for all tax-related operations (VAT returns, corporate tax, etc.) and contractual matters, and appears on invoices, contracts, pay slips, etc.

The CIF: Company Identification Code (old)
The CIF (Código de Identificación Fiscal) was the tax number assigned to Spanish companies and other legal entities. Until 2008, each company had its own CIF, with a format identical to the company NIF (a letter + seven digits + control character). For example, a CIF could be A12345678 (where the letter "A" designated a public limited company). This code was used for all commercial and administrative operations of the company.
In 2008, the distinction between CIF and NIF was abolished by new Spanish legislation: Royal Decree 1065/2007 repealed the CIF, which was merged into the general NIF system. Since this reform, we simply speak of NIF for legal persons. A company's identification is now done with this NIF-"CIF" using the same logic of letter + numbers. However, the term "CIF" remains very common in everyday language. It should be noted that the CIF no longer officially exists (since 2008), but the company NIF inherits its structure.
Good to know
Besoin d'aide pour obtenir votre NIE blanc en Espagne ?
Notre équipe d'experts vous accompagne pour obtenir votre NIE blanc (non-résident) sans vous déplacer.
Plus de 300 NIE blancs obtenus
"Julia est super efficace : NIE obtenu en quelques jours."
Marie
Espagne
Summary Table
| Number | Concerns | Format | Example |
|---|---|---|---|
| DNI | Spanish citizens (≥ 14 years old) | 8 digits + 1 letter | 12345678A |
| NIE | Foreigners (residence, employment, property purchase…) | 1 letter (X/Y/Z) + 7 digits + 1 letter | X1234567B |
| NIF (individual) | Natural persons (Spaniards = DNI / Foreigners = NIE) | Same as DNI or NIE | 12345678A or X1234567B |
| NIF (company) | Companies and legal entities | 1 letter + 7 digits + 1 letter/digit | B12345678 |
| CIF (old) | Companies (until 2008) | 1 letter + 7 digits + 1 letter/digit | B12345678 |
This summary table allows for a quick visualization of the essential information and concrete examples for each type of number. For example, for a Spaniard, the DNI and the individual NIF will be the same number (8 digits + letter), while a foreigner will have a NIE starting with X, Y, or Z, which also serves as their NIF. For companies, the NIF-"CIF" starts with a letter identifying the type (A, B, etc.) followed by 8 characters.
Besoin d'aide pour obtenir votre NIE blanc en Espagne ?
Notre équipe d'experts vous accompagne pour obtenir votre NIE blanc (non-résident) sans vous déplacer.
Plus de 300 NIE blancs obtenus
"Julia est super efficace : NIE obtenu en quelques jours."
Marie
Espagne
Frequently Asked Questions about ID numbers in Spain
What should I do if a form in Spain asks for a DNI and I don’t have one?
If you are a foreigner, provide your NIE, as it is your main identifier in Spain. For Spaniards residing abroad without a DNI, the consulate advises obtaining an NIF L through their consular post. In some cases (renewal in progress), you can write "EN TRÁMITE" in the DNI/NIE field, pending the actual issuance. Depending on the situation, the procedures to obtain or use these identification documents may vary.
Can a foreigner obtain a Spanish DNI?
No. The DNI is reserved for Spanish nationals and is their main identity document. According to consular services, the NIE is 'exclusively for non-Spanish nationals.' In other words, a foreigner does not have a DNI until they acquire Spanish nationality. If they become a naturalized Spaniard, they must then apply for a DNI (and will use this new number as their NIF).
What is the difference between NIE and NIF?
They are related concepts. The NIE is the personal identification number assigned to foreigners, while the NIF is the tax identification used for everyone. In practice, for a foreigner, their NIE also serves as their NIF. The NIF is a general term (valid for individuals or companies), whereas the NIE applies only to foreigners. The NIE is not an identity document in itself, but an identification number necessary for many administrative procedures.
What is the company NIF (formerly CIF)?
Spanish companies have a specific NIF assigned upon their creation. Historically called CIF, it has the exact same structure (9 characters) and is used for the company's tax identification. As mentioned, since 2008 it is simply called the company "NIF". This number is essential for identifying companies in all administrative and tax procedures.
What should a foreigner without a DNI enter on a website?
On an online form requesting a DNI, an expatriate or foreigner should generally enter their NIE. If the NIE is "in progress," some forms allow typing EN TRÁMITE ("in process") instead of the number.
In which situations is an identity document or identification number needed in Spain?
Identity documents (like the DNI for Spaniards) and identification numbers (NIE, NIF, company NIF) are required in many situations: opening a bank account, buying or renting a property, registering with tax authorities, residency procedures, or starting a business. Depending on each situation, it is important to follow the specific administrative procedures to present the correct document or identification number.
These answers to frequently asked questions illustrate concrete cases where the differences between DNI, NIE, NIF, and CIF can be confusing. In summary, the DNI is for Spaniards (>=14 years old), the NIE is for foreigners active in Spain, and the NIF is the tax number (corresponding to a person's DNI or NIE). The CIF, no longer officially exists since 2008 (replaced by the company NIF). Understanding these distinctions is essential for correctly filling out administrative and tax documents in Spain.

