Apply for a NIF in Spain for foreign companies
If you run a Dutch BV, German GmbH, French SARL or UK Ltd and you start selling products, leasing premises or signing contracts in Spain, the question of a Spanish NIF for your foreign company comes up quickly. The general rule is clear: as soon as a foreign company carries out an economic operation on Spanish soil, it must identify itself with the Agencia Tributaria through a NIF, even without having a subsidiary or establishment there.
This article explains exactly when a Spanish NIF becomes mandatory for a foreign company, what the two main categories are (NIF type N for entity without establishment, NIF type W for permanent establishment), how to obtain it step by step, what cost to expect, and which mistakes to avoid to prevent tax assessments. We also detail the cases where a simple intra-EU VAT number is enough and where a full NIF is not necessary.
When must a foreign company obtain a Spanish NIF?
Any economic operation carried out in Spain by a foreign entity potentially triggers the NIF obligation. Here are the main cases.
Property purchase or sale
If your foreign company buys or sells a property in Spain (warehouse, office, rental building), it must obtain a NIF type N before signing the notarial deed. Without a NIF, the notary cannot register the operation in the Registro de la Propiedad under the company's name.
Selling products or services in Spain
Selling physical products in Spain (e-commerce with local stockholding, B2B sales with delivery in Spain, mobile food trucks) requires a NIF if you invoice with Spanish VAT. Cross-border B2C sales without local stock are more flexible: they often fall under the OSS (One-Stop-Shop) regime that avoids the NIF, but as soon as there is a warehouse in Spain or local dropshipping, the NIF becomes mandatory. The VAT framework is detailed in check which VAT rate applies to your products or services.
Renting commercial premises
Leasing an office, warehouse or commercial space in Spain in your foreign company's name requires a NIF to sign the lease. The Spanish landlord cannot issue an invoice (with IVA and IRPF withheld) without the tenant's NIF.
Hiring an employee in Spain
If your foreign company hires a salaried worker resident in Spain, it becomes an employer on the territory and must obtain a NIF type W (permanent establishment), register with the TGSS as an employer (CCC) and run payslips under Spanish law. For details, see how the Spanish social security system works for businesses.
Setting up a subsidiary (SL)
If you decide to structure your Spanish activity through a legal subsidiary, you set up a Spanish Sociedad Limitada (SL) that will have its own NIF type B. This is the most structured option for a lasting activity. For the procedure, see the step-by-step guide to setting up an SL.
What is the difference between NIF type N and NIF type W?
The foreign company NIF exists in two variants depending on the degree of economic presence in Spain.
NIF type N: foreign entity without permanent establishment
The NIF type N (starting with N) is allocated to a foreign company carrying out operations in Spain without a permanent establishment there: no office, no employee, no local dependent agent. Typical cases: occasional property purchase or sale, services invoiced from abroad, sporadic operations.
The type N entity declares and pays its tax obligations in Spain only for specifically Spanish operations (ITP/AJD on property purchase, modelo 210 on rents, modelo 211 on sale). It does not declare its global turnover in Spain.
NIF type W: foreign permanent establishment
The NIF type W (starting with W) is allocated to a foreign company that has a permanent establishment in Spain: fixed office, branch, dependent agent with signing authority, employee on site with commercial activity, active warehouse. In that case, the establishment is treated as a Spanish fiscal entity for the share of the activity carried out in Spain.
The type W company must file an annual modelo 200 (corporate income tax on profit attributed to the establishment), a quarterly modelo 303 (IVA), and all the other obligations of a standard SL. That is significantly heavier than a type N.
How do you know which applies?
The distinction rests on the fiscal qualification of the permanent establishment under the bilateral tax treaty between Spain and the country of origin. A premises rented occasionally is generally not a permanent establishment; a warehouse with a salaried worker is. A misqualification can trigger Spanish IS adjustments over several years. Before applying, have your situation qualified by a tax expert familiar with international treaties.
How do you obtain a Spanish NIF for your foreign company?
The procedure is structured but requires precise documentation. Count 2 to 6 weeks depending on complexity.
Step 1: prepare the documentation
You must gather the apostilled articles of your foreign company (Hague Convention), the sworn translation of those articles into Spanish, the company's registration certificate in its country of origin (Companies House extract for the UK, Kbis for France, KvK extract for the Netherlands, etc.), and the justification of the request motive (property sale agreement, lease, signed commercial contract).
Step 2: appoint a fiscal representative in Spain
Every foreign company must appoint a fiscal representative in Spain: a Spanish individual or legal entity (or a person resident in Spain with a NIF) who will be the official contact point with the Agencia Tributaria. This is generally the role of the gestoría handling the request. The representative receives tax letters, manages audits and represents the company before the tax office.
Step 3: file the modelo 036
The modelo 036 (census declaration) is the form that requests the NIF. You indicate the type of entity (N or W), the corporate purpose, the address in Spain (representative's office), the applicable VAT regimes, and registration with the Registro de Operadores Intracomunitarios if necessary. The form can be filed online with the representative's digital certificate or in person at the AEAT.
Step 4: obtain the provisional then definitive NIF
Once the complete file is filed, the Agencia Tributaria allocates a provisional NIF within 1 to 2 weeks, then converts it into a definitive NIF after document verification (count 2-4 more weeks). The provisional NIF already lets you carry out the necessary commercial and tax operations.
Step 5: related steps
Depending on your activity, you will need to add: employer alta with the TGSS (CCC) if you hire, registration with the ROI for intra-EU operations, request for an intra-EU VAT number (NIF-IVA), opening a bank account in the company's name. The fiscal representative typically coordinates the whole.
How much does it cost to obtain a foreign company NIF?
Costs vary with complexity and degree of delegation, but here is a realistic range.
Administrative fees
Obtaining the NIF itself is free (no state fee). But the related fees add up:
- Apostille of the articles in the country of origin: €5 to €30.
- Sworn translation of the articles: €200 to €600 depending on volume.
- Gestoría fees as fiscal representative: €800 to €2,000 in the first year (including the NIF request).
Recurring annual costs
Once the NIF is obtained, plan for the fiscal representative's fees (typically €100-€300 per month) plus accounting and tax management costs (modelo 200 if type W, modelo 210 if owner, etc.).
Comparison with setting up an SL
Setting up a Spanish SL subsidiary costs more in year one (notarial deed, share capital, Registro Mercantil registration) but can be more economical long-term if the activity is sustained and significant. To compare, see the step-by-step guide to setting up an SL and taxes for a Sociedad Limitada.
What tax obligations follow the NIF allocation?
Once the NIF is obtained, your foreign company enters the Spanish fiscal system for its operations on the territory.
For a NIF type N
Obligations are limited to Spanish operations. If the company owns a rental property, it files the quarterly modelo 210 on rents (with deductions for EU/EEA citizens, none for non-EU). If it sells, it files the modelo 210 on the capital gain with a 3% withholding by the buyer. For an understanding of the modelo 210, see how much tax a non-resident pays.
For a NIF type W
Obligations are equivalent to those of a Spanish SL for the share attributable to the permanent establishment. Annual modelo 200 (IS), quarterly modelo 202 (IS prepayments), quarterly modelo 303 (IVA), annual modelo 390 (IVA summary), monthly modelo 111 (salary withholdings), annual modelo 190. See taxes for a Sociedad Limitada for details.
Registration with the ROI (Registro de Operadores Intracomunitarios)
If your company carries out intra-EU operations (B2B purchases or sales with other EU companies), it must register with the ROI to obtain a NIF-IVA. Without that registration, the VAT reverse charge does not apply and you wrongly invoice Spanish VAT.
Calendar to respect
The Spanish tax calendar does not wait. A NIF company that misses its returns is exposed to administrative fines (50-150% of the undeclared amount) and late interest. This is one of the main values added by the fiscal representative: keeping the calendar up to date.
What pitfalls are specific to foreign companies?
Several mistakes recur and can cost you dearly.
Underestimating the permanent establishment qualification
Many foreign companies think they have no permanent establishment when they do fiscally. A commercial agent negotiating in their name, a warehouse with Spanish staff, a website hosted locally with stock: any of these can qualify as a permanent establishment and change the applicable tax regime. A bad qualification can lead to IS adjustments over 4 years plus penalties.
Failing to appoint a fiscal representative
A foreign company without a fiscal representative sees its mail returned unanswered, ending in default sanctions. Appoint a reliable representative from the NIF request.
Forgetting the ROI for intra-EU operations
Without ROI registration, your company invoices Spanish VAT on intra-EU B2B operations when it should apply the reverse charge. Your EU clients refuse those invoices and you have to issue corrections.
Confusing subsidiary NIF and foreign entity NIF
If you hesitate between setting up a Spanish SL subsidiary (NIF type B) and obtaining a NIF type N/W for the foreign entity, know that the tax and legal regimes are entirely different. The SL is a separate Spanish legal entity, the foreign entity remains under the law of the country of origin. Choosing depends on volume of activity, long-term outlook, and risk profile. The difference between identifiers is detailed in the difference between NIE and NIF in Spain and what is a NIF number and why you need it.
Failing to update changes
If the address, representative or tax regime changes, you must file a fresh modelo 036 to update. Failing to do so generates inconsistencies that eventually alert the tax office.
When should you prefer an SL over a foreign company NIF?
The trade-off between the two structures depends on several criteria.
Prefer the foreign company NIF if...
You have an occasional or small-scale activity in Spain, you do not plan to hire, your transaction volume stays under the €100,000 annual mark, or you want to test the Spanish market before a more structured investment. The NIF type N is fast to obtain (4-6 weeks) and inexpensive to maintain.
Prefer setting up an SL if...
You plan a sustained, significant activity in Spain, you will hire local staff, your volume exceeds €200,000-€300,000 a year, or you want to protect your foreign assets through a separate legal entity. The SL costs more to create (€1,500-€3,000 in the first year) but offers fiscal optimisation, limited liability, and superior commercial credibility. The trade-off is also covered in the pros and cons of autónomo versus SL in Spain.
Mixed case: SL later
Many companies start with a NIF type N to test the market, then switch to an SL once activity is confirmed. This is a reasonable strategy, but it requires careful planning of the fiscal transition (notably the transfer of accumulated assets under the foreign NIF to the new SL).
Where to start with your Spanish activity
The Spanish NIF for your foreign company is the mandatory checkpoint as soon as an economic operation takes place on Spanish soil. The complexity of the file (apostille, translation, fiscal representative, permanent establishment qualification) often justifies relying on a local gestoría, especially for companies discovering the Spanish tax system.
The practical rule: qualify your establishment type before requesting the NIF (N or W), prepare the apostilled and translated documentation in advance, appoint a reliable representative, and anticipate recurring tax obligations in your cost forecasts. Without this preparation, the NIF is obtained but the activity quickly drifts into costly tax errors.
Preparing an operation in Spain (property purchase, hiring, branch opening) and wondering which structure to adopt? At gestoraz, we can quote both scenarios (foreign NIF vs SL subsidiary), recommend the best option for your case, and run the procedure end-to-end.
Official sources
- Agencia Tributaria, modelo 036, sede.agenciatributaria.gob.es: census declaration and company NIF request.
- Real Decreto Legislativo 5/2004 (IRNR) (BOE), boe.es/buscar/act.php?id=BOE-A-2004-4527: non-resident income tax and permanent establishments.
- Bilateral tax treaties, hacienda.gob.es: qualification of the permanent establishment and rules of taxation.
- Real Decreto 1065/2007 (BOE), boe.es/buscar/act.php?id=BOE-A-2007-15984: regulation on the NIF and CIF/NIF unification.
- Hague Convention on the Apostille, hcch.net/en/instruments/conventions/full-text/?cid=41: reference for the apostille of company articles.
- Registro Mercantil Central, rmc.es: registration of Spanish companies.
Obtain your Digital Certificate entirely remotely.
Request your Digital Certificate completely remotely.