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.
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
ESprefix, 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.
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.
What to do if the number is invalid
An "invalid" result does not mean fraud. Go through these steps in order:
- reread the number:
ES, 9 characters, letters included; - ask the customer for its exact NIF-IVA, with its company name, and whether it is registered in the register of intra-EU operators;
- try again later: a recent registration may not appear yet;
- keep a record of the check: date and result;
- without a valid number, talk to your accountant before invoicing without VAT.
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.
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.
Keep reading
- VATCheck a German VAT number (USt-IdNr)DE + 9 digits: the format of the USt-IdNr, frequent errors, the official check and what to do when it is invalid.
- VATCheck an Italian VAT number (partita IVA)IT + 11 digits: the format of the partita IVA, frequent errors, the official check and what to do when it is invalid.
- VATCheck a Belgian VAT number (BE + 10 digits)BE + 10 digits, the first 0 or 1: the format, frequent errors, the official check and what to do when it is invalid.
- VATCheck a Dutch VAT number (btw-id)NL + 9 digits + B + 2 digits: the format of the btw-id, the difference with the omzetbelastingnummer and the official check.
- VATFrench VAT number: format and how to check itThe French, Belgian and Swiss formats, the mentions on the invoice and the check before invoicing.