akwitoEU VAT proof

Spanish VAT number (NIF-IVA): format and VIES check

The Spanish VAT number: ES and the 9-character NIF. Valid in Spain does not mean valid in VIES: ROI registration, and the missing company identity.

Published on · akwito

The VAT number at a glance: Spain

Prefix
ES
Format
ESX9999999X9: a digit · L: a letter · X: a digit or a letter
Check digits
Recomputed by akwito before querying VIES
Name and address in VIES
Not returned: VIES answers “---”
VIES for this country
Available 99.9% over 30 days · Availability by country

Check a number

One number, one result, no account. The timestamped PDF certificate comes with the free account.

In Spain, the EU VAT number is the NIF (número de identificación fiscal) preceded by ES, known as the NIF-IVA. It has 9 characters after the prefix.

The format #

The NIF comes in three main forms, recognisable by its first character:

  • a company (the former CIF): a letter giving the legal form (A for a sociedad anónima, B for a sociedad limitada…), 7 digits, then a check character, digit or letter;
  • a Spanish individual: the 8 digits of the DNI, then a check letter;
  • a foreign individual: the NIE, starting with X, Y or Z, then 7 digits and a check letter.

For these three forms, akwito recomputes the check character before querying VIES.

Valid in Spain, invalid in VIES #

This is the Spanish trap. A NIF exists from registration, but it is only valid in VIES if the business is registered in the ROI, the Registro de Operadores Intracomunitarios kept by the Agencia Tributaria. Registration is requested through the census declaration (modelo 036). A small business that only sold in Spain can therefore have a perfectly real NIF and an “invalid” answer in VIES.

In that case, a VAT-free invoice is not safe: ask your customer to register in the ROI, and check again before invoicing. The guide Invalid EU VAT number: what should you do? describes the steps.

What VIES returns for Spain #

As for Germany, VIES returns validity with no name or address: both fields read “---”. The guide Germany and Spain: why VIES does not return the company name explains why, and the German VAT number page describes the same problem on the other side of the Rhine.

What akwito does with a Spanish number #

  • Format and check character, before any call.
  • Validity in VIES, with the consultation number that dates it.
  • Identity, looked up in public sources: the Legal Entity Identifier register (GLEIF), the EORI customs registration database, and identities that VIES has already confirmed in earlier checks. The identity found is submitted to VIES, which answers field by field “match” or “mismatch” when the member state processes the request.
  • A certificate that states what is missing: when no source provides an identity, it says so in plain words.