Spanish company NIF: what it means and how to validate it
How a Spanish company tax ID (NIF) is built, what each letter means and how a foreign business can check a Spanish supplier through VIES and AEAT documents.
IberiaData editorial team · 30 October 2026 · 4 min read
Before you pay a Spanish supplier's first invoice or ship goods to a new Spanish customer, check its tax ID. The NIF (número de identificación fiscal, still often called CIF) is what links an invoice to a legal entity. A typo can break your VAT treatment; a fake or revoked number can mean you are dealing with a company that doesn't really exist.
If you just want to find a company from its tax ID, see how to look up a Spanish company by its tax ID. This guide is about reading and validating the number itself.
How the number is built
Since July 2008, Order EHA/451/2008 sets a nine-character structure for companies and other entities:
- A letter showing the legal form, or that it is a foreign entity or a permanent establishment.
- Seven random digits. They no longer encode the province, so don't infer location from them.
- A check character, which can be a digit or a letter.
A company keeps its NIF when it changes name, address or directors. It only changes if the legal form or nationality changes (Royal Decree 1065/2007, Article 22).
The letters you will meet most often
| Letter | Entity |
|---|---|
| A | Sociedad anónima (public limited company) |
| B | Sociedad de responsabilidad limitada (private limited company, SL) |
| E | Community of property and other entities without legal personality |
| F | Cooperative |
| G | Association |
| J | Civil partnership |
| N | Foreign entity |
| U | Temporary joint venture (UTE) |
| W | Permanent establishment of a non-resident entity |
The full list also includes C, D, H, P, Q, R, S and V (partnerships, owners' associations, public bodies and others). Sole traders (autónomos) don't have a company NIF: they invoice with their personal one, the DNI number plus a letter for Spaniards, or the NIE for foreign residents.
Step 1: check the format
A correct check character means the number is well formed and probably typed correctly. Most ERP and invoicing systems run this test on entry. It tells you nothing about whether the company exists or is active.
Step 2: check VIES for intra-EU trade
If you are an EU business buying from or selling to a Spanish company, you need its VAT number: the NIF with the prefix ES (for example ESB12345678). Check it in the European Commission's VIES service.
An "invalid" result has a specific Spanish twist. A Spanish business only gets an EU VAT number once it registers in the Register of Intra-Community Operators (ROI) using form 036. A real, active company that has never traded with other EU countries may not appear. Ask the counterparty; the VAT treatment of your invoice depends on the answer, so confirm it with your tax adviser.
Step 3: confirm the company is active
The Spanish tax agency (AEAT) runs a third-party NIF check that returns results such as identificado, identificado-baja (deregistered) or identificado-revocado (revoked). It requires Spanish electronic ID (Cl@ve or a digital certificate), so foreign firms usually can't use it themselves.
Two practical alternatives:
- Ask for a census certificate. A Spanish company can obtain a certificate of its census status from the AEAT. AEAT documents carry a secure verification code (CSV) that you can check on the AEAT website, so a doctored PDF won't pass.
- Check the Companies Register gazette. BORME publishes incorporations, director appointments, liquidations and insolvency notices. Our guide on checking whether a Spanish company exists walks through it.
Your Spanish accountant or lawyer can also run the census check for you.
Red flag: a revoked NIF
The AEAT can revoke a company's NIF when, among other reasons, it declared non-existent activities, used a sham address or failed to file annual accounts with the Companies Register for four consecutive years (Royal Decree 1065/2007, Article 147). Revocations are published in the BOE, remove the company from the ROI (so it drops out of VIES) and stop the AEAT from issuing it a tax compliance certificate.
If a new supplier's NIF is revoked, stop. If it is a customer that owes you money, talk to a Spanish lawyer before deciding how to claim.
| When | What to check |
|---|---|
| Onboarding a supplier or customer | Format, legal name, census certificate |
| Before the first intra-EU invoice | ES VAT number in VIES |
| Before a large payment or contract | BORME and directors |
| Once a year | Re-run VIES and ask for updated certificates from key suppliers |
Once the NIF checks out, you will probably want to talk to someone at the company. On IberiaData you search by tax ID and see whether the profile has a phone, an email or both before paying. If you plan to contact Spanish companies to sell to them, remember that sole traders are natural persons (legal basis and Robinson list screening required) and that the LSSI restricts unsolicited commercial email, even between businesses. Read our guides to cold calling in Spain and cold email and the LSSI first, and see the suppliers and sourcing use case.
Frequently asked questions
What is the format of a Spanish company NIF?+
Nine characters: a letter showing the legal form, seven random digits and a check character, as set by Order EHA/451/2008. The Spanish VAT number for intra-EU trade is the same NIF with the prefix ES.
A Spanish supplier's VAT number shows as invalid in VIES. Is it fake?+
Not necessarily. Spanish businesses only appear in VIES if they are registered in the Register of Intra-Community Operators (ROI). Ask them whether they are registered before treating the supply as intra-EU.
Can a foreign company use the Spanish tax agency's NIF checker?+
The AEAT's third-party NIF check requires Spanish electronic identification, so most foreign firms can't use it directly. A practical alternative is to ask the supplier for its AEAT census certificate and verify the document's secure code on the AEAT website.
Written and reviewed by the IberiaData editorial team. Last updated: 30 October 2026. If you spot anything out of date, let us know.