Every Spanish company has a tax identification number, the NIF (many people still call it CIF, its old name for companies). You need it for invoices, contracts and onboarding, and you'll want to know it's right. Spain gives you two official ways to check a NIF, each with its limits, and the commercial registry gazette (BORME) doesn't publish NIFs at all. This guide explains how the number is built, how to check it, and how to connect it to the right company.
Rules come from the BOE and the Agencia Tributaria (AEAT), read on 10 October 2026.
What you'll learn
- How a company's NIF is built, and what its first letter tells you
- The AEAT's check for third-party NIFs, and who can use it
- What VIES adds for intra-EU business
- Why the BORME doesn't help with NIFs, and what to do instead
- A checklist for your customer and supplier file
How a company's NIF is built
According to Order EHA/451/2008 (BOE-A-2008-3580), the NIF of a legal person or entity is made of:
- a letter that gives the legal form, for a Spanish entity, or shows that it's a foreign entity or a permanent establishment;
- a seven-digit number;
- a control character.
Among the letters for Spanish entities, the order lists A for public limited companies (sociedades anónimas) and B for limited liability companies (sociedades de responsabilidad limitada). Foreign entities' NIFs start with N, and permanent establishments of non-resident entities with W.
So a NIF starting with B usually belongs to an S.L., and one starting with A to an S.A. It's a useful sanity check: a supplier that calls itself an S.A. but gives a NIF starting with B deserves a question. See Spain's S.L. and S.A. forms.
The control character catches many typing errors, but a well-formed NIF can still belong to someone else, or to nobody.
Check 1: the AEAT's third-party NIF check
The Agencia Tributaria offers a service called "Comprobación de un NIF de terceros a efectos censales". According to its help page (updated on 9 October 2026):
- Access: you identify yourself with Cl@ve Móvil, an electronic certificate or an electronic ID card (DNIe). It's not an anonymous public search.
- Queries: one NIF at a time, a list typed line by line, or a CSV file of up to 20,000 records.
- Legal entities: you don't need to enter the company name.
- Results: for individuals, "IDENTIFICADO", "NO IDENTIFICADO-SIMILAR" or "NO IDENTIFICADO"; for legal entities, the page also lists "IDENTIFICADO-BAJA" and "IDENTIFICADO-REVOCADO", which point to a deregistered or revoked NIF.
The service exists to clean taxpayer identification data before filing declarations. For a business that invoices Spanish companies, it's the authoritative way to confirm that a NIF is identified in the tax census, and to catch revoked ones.
Check 2: VIES, for intra-EU trade
If your customer trades within the EU, its NIF may also be registered as a VAT number in VIES, the European Commission's service: "ES" plus the NIF. In our test on 9 October 2026, a Spanish number came back valid, but with the name and address shown as "---": Spain doesn't display them. VIES tells you the number is registered for intra-EU VAT, not who holds it. See checking a VAT number with VIES.
Why the BORME doesn't help
The BORME publishes the acts registered in the commercial registry: incorporations, appointments, office moves, extinctions. It identifies each company by its registry sheet in its province, not by NIF, and doesn't publish NIFs. So you can't go from a NIF to a company's registered acts using the BORME alone.
What you can do:
- Ask your counterparty for its exact legal name along with the NIF, and find the company in the registry by name and province. See how to check a Spanish company before you sign.
- Order the registry's information note (nota simple informativa) when it matters: the Colegio de Registradores' online office lets you search by company name or NIF.
Common situations
- The NIF starts with B but the company calls itself an S.A. Ask. The company may have changed form since the NIF was assigned, or the number may belong to another company.
- The NIF starts with N or W. A foreign entity or a permanent establishment of a non-resident entity, according to the order: you may be dealing with a branch, not a Spanish company.
- VIES says invalid but the customer insists the NIF is right. VIES covers intra-EU VAT registration; a company can have a NIF without being registered for intra-EU operations. Ask the customer.
- You can't use the AEAT check (no Cl@ve or certificate). Ask your tax adviser, or the customer, for proof of the NIF.
A checklist for your file
| Field | Source | Check |
|---|---|---|
| NIF | Your counterparty, in writing | Format and control character |
| NIF identified | AEAT third-party check | IDENTIFICADO, not BAJA or REVOCADO |
| Intra-EU VAT | VIES | Valid, for intra-EU sales |
| Legal name and form | Registry (BORME, nota simple) | Matches the NIF's letter and the contract |
| Province and registry sheet | BORME | Stored, to follow the company's acts |
Keep the NIF and the registry identity in separate fields: they come from different authorities and change for different reasons.
Fuentio doesn't look companies up by NIF, because the BORME doesn't publish it. Its API will return Spanish companies found by name, with their province, registry sheet and dated BORME acts. It isn't open yet: join the waitlist below to hear the day it opens.
See what we cover in France and Spain.
Limits. The NIF composition comes from Order EHA/451/2008 (BOE), and the third-party check from the AEAT's help page (updated on 9 October 2026), read on 10 October 2026; the VIES result is the one we got on 9 October 2026. Fuentio doesn't check NIFs. Not legal or tax advice.
Frequently asked questions
Is the CIF the same as the NIF?
For companies, yes: CIF was the old name. Today the tax identification number of a company is its NIF.
What does the first letter of a company's NIF mean?
It gives the legal form for Spanish entities: for example A for an S.A. and B for an S.L., according to Order EHA/451/2008.
Can anyone check a Spanish NIF online?
The AEAT's third-party check requires identification with Cl@ve, a certificate or an electronic ID. VIES is open to anyone but only covers VAT registration.
Can I find a company's acts in the BORME from its NIF?
No. The BORME doesn't publish NIFs. Search by the exact legal name and province.
Sources
- Order EHA/451/2008 of 20 February, composition of the NIF of legal persons (BOE-A-2008-3580): boe.es
- Agencia Tributaria, checking a third party's NIF (updated on 9 October 2026): sede.agenciatributaria.gob.es
- European Commission, VIES: ec.europa.eu
- Colegio de Registradores, commercial information note: sede.registradores.org
- BOE, BORME daily gazette: boe.es
