A NIF in Spain is the Número de Identificación Fiscal, the tax identification number the Spanish government uses to tie any person or organization to their financial and legal activity in the country. The Agencia Tributaria, Spain’s tax agency, treats it as the single identifier behind every tax return, property deed, bank account, employment contract, and notarized transaction. If you plan to live, work, buy property, inherit assets, or run a business in Spain, you need one.
The NIF isn’t one document. It’s an umbrella category that takes a different form depending on who you are.
The Three Forms a NIF Takes
Which number functions as your NIF depends entirely on your status.
- Spanish citizens use their DNI (Documento Nacional de Identidad). The eight-digit number on the national ID card, plus its verification letter, is their NIF.1La Moncloa. Differences Between the DNI, the NIE and the NIF: What They Are and How to Obtain Them
- Foreigners use their NIE (Número de Identificación de Extranjero), a unique number issued by the Ministry of Interior to any foreigner with economic, professional, or social ties to Spain.2Ministry of Foreign Affairs, European Union and Cooperation. Tax Identification Number (NIF)
- Companies, associations, cooperatives, and similar legal entities receive their own NIF directly from the Agencia Tributaria. This replaced the older CIF (Código de Identificación Fiscal) under Order EHA/451/2008.3Tax Agency. NIF: Assignment of a NIF to Legal Persons and Non-Legal Entities
Two temporary categories cover people caught between statuses. A Spanish national living abroad without a DNI gets a “NIF L,” valid until they obtain the DNI. A foreigner who needs a tax number before securing a NIE gets a “NIF M,” valid until the proper NIE is issued and reported back to the tax agency within two months.2Ministry of Foreign Affairs, European Union and Cooperation. Tax Identification Number (NIF)
Across every type, the number is a nine-character alphanumeric code: digits for Spanish citizens, a leading X, Y, or Z for foreigners, and a leading entity-type letter for companies, each ending in a control character.
Who Needs a NIF
Spanish citizens get theirs automatically through the DNI. For everyone else, the question is practical: what are you trying to do in Spain?
You need a NIE, which becomes your NIF, in any of these situations:
- You’re living in Spain for work, study, or retirement, which means dealing with virtually every public administration.
- You own or plan to buy property. The deed, the land registry, and the related tax filings all require a NIF.
- You’re a partner, administrator, or director of a Spanish company and need to act in that role.2Ministry of Foreign Affairs, European Union and Cooperation. Tax Identification Number (NIF)
- You’re inheriting assets in Spain. Non-resident heirs cannot pay inheritance tax, open a Spanish bank account to receive estate funds, or register inherited property without one.
- You have any economic transaction in Spain, even a one-off contract or investment.
Legal entities face a parallel rule: any company that will have tax-relevant dealings in Spain must request a NIF within one month of its incorporation or establishment, and before making deliveries, acquiring goods, collecting payments, or hiring employees.3Tax Agency. NIF: Assignment of a NIF to Legal Persons and Non-Legal Entities
What You Can’t Do Without It
The NIF is the key that unlocks almost every financial and administrative door in Spain. Without one, you’re effectively locked out of the system.
Banking and Property
Banks require a NIF to open any account. Property purchases can’t move forward because the notary, the land registry, and the tax forms all demand it. The same goes for leases, loan agreements, and investment contracts.2Ministry of Foreign Affairs, European Union and Cooperation. Tax Identification Number (NIF)
Work and Social Security
You cannot work legally in Spain without a NIF. Employers need it to pay you, withhold taxes, and register you with the social security system. Freelancers and self-employed professionals use their NIF to register as business owners through the census declaration (Form 036).3Tax Agency. NIF: Assignment of a NIF to Legal Persons and Non-Legal Entities
Tax Filing
Every self-assessment, declaration, and communication to the tax administration must carry the taxpayer’s NIF. That applies to residents filing annual income tax and to non-residents filing on Spanish-source income or property.2Ministry of Foreign Affairs, European Union and Cooperation. Tax Identification Number (NIF)
Digital Government Access
Spain handles more and more government business online, and the NIF is the gateway. A DNI or NIE is required to apply for an FNMT digital certificate, which lets you file taxes, check social security records, and interact with agencies electronically.4Ministry of Foreign Affairs, European Union and Cooperation. Digital Certificate The same number also registers you for the Cl@ve identification system used across public services.5Plataforma ONE. Application for Clave Digital Certificate
Everyday Services
Setting up water, electricity, or similar utilities generally requires presenting your ID card or NIE as part of the contract.6Punto de Acceso General electrónico. Connection to the Water Supply Buying a vehicle, registering for public health care, and enrolling children in school all draw on the same number.
How a Foreigner Gets One
Most foreigners get their NIF by applying for a NIE. If you’re already in Spain, the application goes through a police station (Comisaría de Policía) or Immigration Office (Oficina de Extranjeros), and you book an appointment (cita previa) in advance; each family member needs a separate appointment. If you’re outside Spain, you apply through the nearest Spanish consulate or embassy.7Plataforma ONE. Application for NIE for International Individuals
You bring Form EX-15, your passport with a color copy of the data page, and documentation supporting the reason you need the NIE, such as a purchase contract, job offer, or business registration.8Ministry of Foreign Affairs, European Union and Cooperation. Foreigner Identity Number (NIE) The fee in Spain is €9.84, paid at a bank using a Tasa 790 (código 012) before your appointment.9National Police Electronic Headquarters. Foreigner Processing Fees Consulate fees vary; the Spanish Consulate in New York, for example, charges $12 for a first-time NIE.10Spanish Consulate New York. Consular Fees 2026
Officially, the authorities must resolve the application within five business days.11National Police Electronic Headquarters. Foreigner – Assignment of NIE Upon Request The real delay is usually getting the appointment itself, which can take weeks in high-demand cities like Madrid and Barcelona.
If you need a tax number before you can get a NIE, you can apply directly to the Agencia Tributaria using Form 030. That produces the temporary “NIF M,” and the application can be submitted remotely through the agency’s electronic headquarters by someone acting on your behalf with an existing electronic certificate.12Tax Agency. Form 030 – Application for NIF of a Natural Person Without DNI/NIE – Not in Person
Does the NIF Expire?
The number itself is permanent. Once assigned, your NIE stays with you for life and does not change, even if you leave Spain or let your residency lapse. The paper certificate you receive at the window, however, often carries a printed validity period of around three months. When the certificate expires, the number remains valid, but some institutions may want to see a current document and ask you to request a fresh certificate.
The “NIF M” is different: it stays active only until you obtain a proper NIE, and you then have two months to notify the tax agency so your records link to the permanent number.2Ministry of Foreign Affairs, European Union and Cooperation. Tax Identification Number (NIF) Non-EU residents who later receive a TIE residency card hold a card with an expiration date, but the NIE number printed on it does not change.
What Happens If You Don’t Have One
Operating in Spain without a NIF when you need one creates real exposure. Under Spain’s General Tax Law, failing to submit a tax declaration on time carries a flat €200 fine, reduced by half if you file late on your own initiative before the tax agency contacts you. An incomplete or inaccurate declaration draws a €150 fine, and filing in the wrong format costs €250.13EUR-Lex. Commission v Spain (Obligation to Provide Tax Information)
The practical consequences bite faster than the fines. Without a NIF you cannot register property in your name, pay inheritance tax on Spanish assets, or complete a notarized transaction. Banks will not open an account. Employers cannot legally pay you. The number is embedded so deeply in Spanish administration that going without it means being unable to participate in the system at all.