In Spain there are two distinct tax identification numbers for foreign subjects: the personal NIE (Número de Identidad de Extranjero — Foreigner's Identity Number), for natural persons, and the NIF for non-resident entities, for companies and other legal entities. Confusing them — or attempting to use the shareholder's NIE to identify the company — is one of the most frequent mistakes in the first transactions of foreigners in Spain. This article explains when each is needed, how to apply, and how long each takes.
The personal NIE: identification of the foreign natural person
What the NIE is
The Número de Identidad de Extranjero (NIE) is the personal identification code assigned by the Ministry of the Interior to foreign nationals who have economic, professional, or social relationships in Spain. Its format is X-00000000-A (initial letter X, Y, or Z + 7 digits + check letter).
It is not a residence permit: it is an identification number. A foreign national can have a NIE without residing in Spain (for example, a non-resident who buys property or holds shares in a Spanish company).
When the personal NIE is needed
- Purchase of real estate in Spain.
- Opening a bank account in Spain.
- Formation of, or participation as a shareholder in, a Spanish company.
- Appointment as director of a Spanish company.
- Obtaining a residence or work authorisation.
- Filing tax returns in Spain (IRNR, IRPF on acquiring tax residence).
- Signing employment or commercial contracts that must be registered in Spain.
- Self-employment registration with the TGSS.
How to apply for a personal NIE
Route A: from Spain (Police Station)
- Book an appointment at the Police Station competent for the address in Spain (or at any Police Station with immigration services if there is no fixed address).
- Bring: valid passport (original + copy), completed EX-15 form, a recent photograph, and evidence of the reason for needing the NIE (deed of sale, employment contract, power of attorney from the Spanish company, etc.).
- Pay the Model 790 code 012 fee (approximately €10–12).
- The NIE may be issued on the day of the appointment or within 1–3 working days.
Route B: from abroad (Spanish consulate)
Foreign nationals not yet in Spain can apply for the NIE at the Spanish consulate in their country of habitual residence. The process is similar, with the same documents adapted to the consular format. Processing time varies by consulate: between 2 and 8 weeks.
Route C: through a legal representative
A lawyer or gestor with a notarised power of attorney can apply for the NIE on behalf of the applicant. This route is very common for foreign investors buying property in Spain without travelling. The power of attorney must be specific to the NIE application and may require an apostille if granted abroad.
Emergency NIE for urgent cases
If the transaction requiring the NIE is urgent (imminent notarial signing, expiring legal deadline), the NIE can be applied for on an emergency basis by evidencing the urgency. Police Stations in Madrid and Barcelona have systems to handle these situations with resolution in 24–48 hours.
The NIF for non-resident entities: identification of the foreign company
What the NIF for a non-resident entity is
The NIF (Número de Identificación Fiscal) for a non-resident entity is the code assigned by the Spanish Tax Agency (AEAT) to foreign companies, foundations, associations, and other legal entities carrying out transactions in Spain. Its format is N-00000000-A (letter N + 8 digits + check letter).
Although it is sometimes colloquially called the “business NIE” or “company NIE”, technically it is an entity NIF — tax law distinguishes it from the personal NIE.
When the NIF for a non-resident entity is needed
- Foreign company acquiring real estate in Spain.
- Foreign company employing staff in Spain (even just one person).
- Non-resident entity with a permanent establishment in Spain (branch, agency, etc.).
- Foreign company that regularly invoices Spanish clients and is required to file tax returns in Spain (IRNR, VAT in certain situations).
- Non-resident company that holds shares in a Spanish company.
- Foreign entity that enters into contracts with Spanish public authorities.
How to apply for the NIF for a non-resident entity
The NIF for a non-resident entity is applied for at the AEAT via Form 036 (Census Declaration), checking the box for registration of non-resident entities without a permanent establishment (or with a permanent establishment, as applicable).
Required documents:
- Completed Form 036.
- Tax residence certificate of the entity in its country of origin, issued by the tax authority of that country, apostilled, and with a certified Spanish translation.
- Incorporation deed or constitutive document of the entity (equivalent to the Articles of Association), apostilled and with a certified translation.
- Registry certificate evidencing the entity’s current existence (equivalent to a Spanish Mercantile Registry certificate), apostilled.
- Documentation of the representative — the entity’s fiscal representative in Spain (required for entities without a permanent establishment) must be identified with their personal NIE or DNI.
- Notarised power of attorney evidencing the signatory’s authority.
Processing time: the AEAT typically resolves the application within 15–30 working days of receipt of complete documentation.
The fiscal representative
Non-resident entities without a permanent establishment in Spain must designate a fiscal representative before the AEAT. The representative is a natural or legal person resident in Spain who acts as the entity’s contact with the Administration for tax purposes. Designation does not imply personal liability for the entity’s debts, but does impose an obligation to comply with AEAT information requests.
Comparison table
| Criterion | Personal NIE | NIF for non-resident entity |
|---|---|---|
| For whom | Foreign natural person | Foreign company/legal entity |
| Format | X/Y/Z + 7 digits + letter | N + 8 digits + letter |
| Where applied | Police Station or Spanish consulate | AEAT (Form 036) |
| Processing time | Same day – 3 days (appointment) / up to 8 weeks (consulate) | 15–30 working days |
| Cost | ~€10–12 (Model 790 fee) | Free |
| Expiry | Does not expire (the number is permanent; the TIE card does expire) | Does not expire (unless inactive >4 years) |
| Fiscal representative required | No | Yes (for entities without PE in Spain) |
Special cases
Foreign director of a Spanish company
The director (natural person) needs a personal NIE. The Spanish company they direct has its own NIF (assigned at formation by the Mercantile Registry and AEAT). These are two distinct identification numbers.
Foreign shareholder (natural person) of a Spanish company
Needs a personal NIE for the incorporation deed or the transfer of shares deed.
Spanish subsidiary of a foreign company
The Spanish subsidiary (SL or SA) has its own Spanish NIF assigned at formation. The foreign parent company may need its own NIF as a non-resident entity if it carries out direct operations in Spain (dividend payments, intercompany loans, etc.). These are two different NIFs.
Need to obtain a personal NIE or a NIF for your foreign company in Spain? Speak with BMC’s immigration and tax team.