Jsonpage ยท SIREN and SIRET API

Check a Spanish VAT number: format and check of the NIF-IVA

A Spanish VAT number, the NIF-IVA, is written ES followed by 9 characters, letters included. Before invoicing a Spanish customer without VAT or approving a supplier, you need to check that it is registered for intra-EU transactions.

01 / FORMAT

Number format

This page gives the format, the traps and the steps to follow.

The NIF-IVA is the Spanish tax identification number (NIF) preceded by the ES prefix. It has 9 characters after the prefix. The first and the last may be letters, the others are digits. An individual has a NIF built on their DNI (8 digits and a letter), a foreigner a NIE that starts with X, Y or Z, a company a NIF that starts with a letter.

Fictitious example, only to show the shape: ESX1234567L. It is nobody's number.

The NIF-IVA is given to a business that registers in the register of intra-EU operators, by ticking box 582 of the census declaration (form 036) with the Agencia Tributaria.

Shape of a Spanish NIF-IVACountryES9 characters (fictitious example)X1234567L
A NIF-IVA is ES followed by 9 characters: the first and the last may be letters. Fictitious example, for the shape only.
Check a VAT numberThe VAT number check tool checks the format and the validity of a European Union VAT number, ES numbers included.
02 / ERRORS

Frequent errors

  • Believing that having a NIF is enough: without registration in the register of intra-EU operators, a Spanish business does not appear in the European check.
  • Leaving out the ES prefix, or the final letter.
  • Writing a digit in place of a letter, or the reverse, for example 0 and O.
  • Not checking the first letter for a company or a NIE (X, Y, Z).
  • Copying hyphens, dots or spaces into the number.
03 / CHECK

How to check it

The official European Union VAT number checking service queries the Spanish database and says whether the number is registered on the date of the check. In Spain, the Agencia Tributaria gives access to this check from its electronic office, with an electronic certificate.

The official check gives three answers: valid, invalid or cannot be checked right now. The last one happens when a national service is unavailable: it is not an invalid number, you need to try again later. A negative answer does not prove either that the company does not exist: it may simply not be registered for intra-EU VAT.

To check a number with no effort, or a whole list, use the VAT number check tool. For an entire customer list, the customer file tool handles it in one go.

Checked on October 15, 2026.

04 / INVALID NUMBER

What to do if the number is invalid

An "invalid" result does not mean fraud. Go through these steps in order:

  1. reread the number: ES, 9 characters, letters included;
  2. ask the customer for its exact NIF-IVA, with its company name, and whether it is registered in the register of intra-EU operators;
  3. try again later: a recent registration may not appear yet;
  4. keep a record of the check: date and result;
  5. without a valid number, talk to your accountant before invoicing without VAT.
05 / OTHER COUNTRIES

Other countries

The principle is the same in every country: a prefix, then a number of characters specific to the country, then an official check.

06 / FREQUENTLY ASKED QUESTIONS

Frequently asked questions

How many characters does a Spanish NIF-IVA have?+

11: the ES prefix followed by 9 characters, of which the first and the last may be letters.

Are the NIF and the NIF-IVA the same?+

The NIF-IVA is the NIF preceded by ES, but it exists only if the business is registered in the register of intra-EU operators.

Why does a Spanish business not appear in the check?+

It may not be registered in the register of intra-EU operators, or its registration is recent.

What if the number is declared invalid?+

Reread the number, ask the customer again with its company name, try again later and keep a record of the check.

07 / RELATED RESOURCES

Keep reading

TRY IT

Try it on your own numbers

The free account gives access to the company record, validation and name search: 100 requests per minute, no credit card.