Home / Tools / VAT Number Checker / Spain
Spanish VAT Number Checker
Spain issues three different tax identifiers that can all appear in VIES as a Spanish VAT number, and telling them apart from the string alone is where most integrations go wrong. A CIF belongs to a company: a letter, seven digits, and a check character. A NIF belongs to a person: eight digits and a letter. A NIE belongs to a foreign national resident in Spain: X, Y or Z, then seven digits and a letter.
That distinction has money attached to it. An autónomo trading on a personal NIF is as validly VAT-registered as an S.L. trading on a CIF, so a checkout that rejects anything not starting with a letter turns away real business customers.
Checked live against VIES, the European Commission’s VAT Information Exchange System. Not affiliated with the European Commission or the Spain tax authority.
Spain VAT number format
- Local name
- NIF / CIF (Número de Identificación Fiscal / Código de Identificación Fiscal)
- Structure
- ES + letter/digit + 7 digits + letter/digit
- Format example
- ESA12345678Illustrative: right shape, not a registered business.
- Standard rate
- 21% · reduced 10%, 4%
Both the first and the last position after the ES prefix can be either a letter or a digit. A regex written for "letter, seven digits, letter" will reject a large share of live Spanish numbers.
How this Spain check works
- Format, in your browser. As you type, the number is compared with the Spain pattern (prefix, length and characters). This costs nothing and sends nothing: a number in the wrong shape is rejected on the spot and never reaches the registry.
- Registration, live. A well-formed number is then looked up in VIES, the European Commission’s VAT Information Exchange System, which says whether it is registered today and, where the register publishes them, the business name and address. Free checks are limited per visitor per hour so the registry is not scraped through this page.
- More checks, or from your code. A free account gives you an API key with 100 validations a month, the same answer as this page as JSON.
What usually goes wrong
Rejecting numbers that begin with a digit
A NIF issued to an individual starts with eight digits. Self-employed people registered for IVA use it as their VAT number, and it resolves in VIES exactly like a company CIF.
Stripping the leading letter along with the country code
VIES wants the country code as its own field, so removing ES is correct. Removing the entity letter that follows it is not — that letter is part of the national number and encodes the legal form.
Reading a valid format as a valid registration
The AEAT deregisters numbers that stop filing. A structurally perfect CIF can be inactive, and only a live lookup tells you which one you are holding.
Frequently asked questions
Is a CIF the same thing as a NIF?
Since 2008 Spain has issued a single NIF to every taxpayer, and CIF survives as the informal name for the company-shaped format — a letter, seven digits, a check character. VIES accepts both, and you do not need to classify which one you have before validating.
Can I validate a Spanish NIE?
Yes, provided the holder is registered for IVA. A NIE identifies a foreign national resident in Spain; when that person registers for VAT, the NIE becomes their VAT number and appears in VIES.
What is the Spanish VAT rate?
The standard IVA rate is 21%. Reduced rates of 10% and 4% apply to categories such as food, transport and books. For cross-border B2B sales inside the EU the reverse charge applies and no Spanish IVA is charged, which is exactly why the buyer's number has to be verified first.
Validating Spain numbers from your own code instead of by hand? The Spain VAT validation API guide has the endpoint, the response shape and examples in four languages. To check a number from another country, go back to the VAT number checker.