← All articles

Investment approach

NIE, DNI and NIF: which number a buyer of a flat in Spain needs

Only Spanish citizens have a DNI; a foreigner needs an NIE. The Registro will not enter a purchase if the escritura lacks all parties' and representatives' tax numbers.

The NIE (número de identidad de extranjero, a foreigner's identity number) is the personal number of a foreigner who has economic, professional or social ties to Spain. The DNI (documento nacional de identidad) is a Spanish citizen's document, with a number of eight digits and a letter, compulsory from age 14 for Spaniards living in the country (La Moncloa). A foreign buyer needs an NIE: without the tax numbers of all parties, the Registro de la Propiedad (Land Registry) will not enter the transaction (art. 254 Ley Hipotecaria).

How the NIE differs from the DNI, NIF and TIE

Four abbreviations denote different things, and the confusion starts with the NIF. The NIF is the tax identifier: for an individual it matches the DNI or NIE number, and companies get their own NIF from the tax office (La Moncloa).

Number or documentWho has itWhat it confirmsRole in buying a flat
DNISpanish citizensIdentity and Spanish citizenshipNot available to a foreigner
NIEForeigners with interests in SpainOnly a number, not identity and not the right to live in the countryServes as the buyer's NIF in the escritura (notarial deed), at the bank and at the tax office
Company NIFLegal entities, including non-resident onesThe company's tax statusNeeded if an SL (Spanish limited company) or a foreign company buys
TIE and passportResidents (TIE, the residence card), all foreigners (passport)IdentityUsed to confirm the buyer's identity at completion

The main difference: the NIE gives neither citizenship nor a residence permit. Under the rules summarised by La Moncloa, it is assigned on application if the foreigner is in Spain lawfully and explains why they need the number.

Why a transaction is not registered without the number

This is a requirement of the law, not a notary's whim. Article 254.2 of the Ley Hipotecaria (the Mortgage Law) forbids entering a property transaction in the Registro de la Propiedad if the document lacks the tax numbers of all participants, and of the persons and companies on whose behalf they act. Such an escritura is treated as a document with a curable defect: registration is possible only after a new escritura in which the numbers are given (art. 254.4).

Two practical things follow. The number is needed by every co-owner, not only by the "main" buyer. And if a representative signs under a power of attorney, the escritura gives the tax numbers of both the representative and the person they represent. How buying under a power of attorney works is covered in the article on the poder notarial.

Where the number will be needed after the purchase

The NIE stays with the flat for years. Under it, a non-resident owner files Modelo 210, the single return for rental income, imputed income on a vacant home and gain on a sale (AEAT).

The deadlines on the same tax-agency page have changed:

  • imputed income for 2026 onwards is declared from 1 April to 31 December of the following year, for the first time from 1 April 2027;
  • rental income with tax due, accrued from October 2026, is filed from 1 to 20 April of the following year;
  • on the sale of a flat, Modelo 210 is filed within three months after a month has passed from the date of the transaction.

If the seller is themselves a non-resident, the buyer withholds 3% of the price and pays it to the tax office on account of the seller's tax (art. 25.2 TRLIRNR). More on the annual return in the article Modelo 210 for a non-resident.

How to get an NIE in time

The NIE is arranged before the arras (the deposit contract), not in front of the notary. The order of steps:

  1. Decide who will be the owner: each co-owner arranges their own number; when buying through a company, the company's NIF is needed.
  2. Choose a channel. Abroad, the application is filed at the Spanish consulate where you live; in Spain, at the oficina de extranjería (immigration office) or a Policía Nacional station, in person or through a representative.
  3. State the reason: for a buyer it is the planned property transaction.
  4. Check that the name and passport number on the NIE certificate match the passport that will be used at completion.
  5. Tell the bank and the notary the number in advance, so that it goes into the draft escritura and the bank documents.

The documents, the fee and the processing times are covered in the article NIE for buying property.

When an NIE alone does not make a purchase work

The NIE does not replace an identity document: at completion a valid passport or TIE is needed. It gives no right to live in Spain, and a decision to move requires a separate immigration procedure. If the purchase goes through a company, a director's NIE does not replace the company's own NIF. And if a representative signs the deal, they need a number too. The tax consequences of ownership for a non-resident are collected on the page taxes for a foreign investor.

Questions and answers

Can I buy a flat in Spain without an NIE?

In practice, no. The Ley Hipotecaria does not allow the purchase to be entered in the Registro if the escritura lacks the tax numbers of all parties, and for a foreigner the tax number is the NIE. Alternatives for a specific case are discussed with the notario (notary).

How does the NIE differ from the NIF?

The NIF is the tax identifier. For a foreign individual it matches the NIE number, for a Spaniard the DNI number, and a company gets its own NIF from the Agencia Tributaria.

Does an NIE give the right to live in Spain?

No. The NIE is only a number for transactions with tax and administrative consequences; the right of residence is arranged separately.

Does a representative who signs the purchase under a power of attorney need an NIE?

Yes. Article 254 of the Ley Hipotecaria requires the tax numbers of everyone who signs the document and of those on whose behalf they act.

Do both spouses need an NIE if they buy the flat together?

Yes, if both become owners. Each co-owner's number must appear in the escritura, otherwise the Registro will not enter the purchase.

Apply this research to a property decision

Connect the topic to a full budget and a documented review of the asset.

Before your first investment decision

12 questions before buying an investment property.

A PDF and one-page worksheet covering entry price, total budget, documents, permits, risks and exit. Receive it in three short steps.

Your budget helps identify suitable strategies. No marketing subscription is created.

Investor resources

LET’S BUILD VALUE

Find a project for your budget — from 1 M€.

WhatsAppTelegram

Step 1 of 3

What investment capital are you considering?

Choose a range for one project in Barcelona or the surrounding area.