Spain's VAT identification system has unique characteristics that often confuse businesses from other EU countries. Spanish VAT numbers have multiple valid formats, and importantly, Spain requires separate registration for intra-community trade. This guide explains Spanish VAT numbers, the critical ROI registration requirement, and how to handle validation issues.
The Spanish VAT number uses the NIF (Número de Identificación Fiscal) as its base. The format is:
ES + 1 character + 7 digits + 1 character
Examples: ESA12345678, ES12345678A, ESX1234567A
The total length is 11 characters. However, the format varies depending on the type of entity, which is why Spanish VAT numbers appear in several different patterns.
The first character of the NIF (after ES) indicates the entity type:
Company NIFs begin with a letter from A through H, or J through U. The letter indicates the legal form:
Format: Letter + 7 digits + control character (letter or digit)
Spanish citizens use their DNI (Documento Nacional de Identidad) number as their NIF: 8 digits plus a control letter. The VAT number becomes ES + 8 digits + letter.
Foreign residents in Spain receive a NIE (Número de Identificación de Extranjero) starting with X, Y, or Z, followed by 7 digits and a letter. For VAT: ES + X/Y/Z + 7 digits + letter.
Spain has a requirement that catches many businesses off guard: to appear in VIES and participate in intra-community trade, Spanish businesses must register in the ROI (Registro de Operadores Intracomunitarios).
A Spanish business can have a perfectly valid NIF for domestic VAT purposes, yet that number will show as invalid in VIES if they have not completed ROI registration. This creates a common scenario where your Spanish customer insists their VAT number is valid (and it is, domestically), but VIES validation fails.
Spanish businesses must apply to the Spanish Tax Agency (Agencia Tributaria) for ROI inclusion. The application is typically made through Form 036 (census declaration), checking the option for intra-community operations. The Tax Agency verifies the business and adds them to VIES once approved.
Businesses that only conduct domestic transactions may never have applied for ROI, as it is not automatic with VAT registration. When they receive an order from an EU customer for the first time, they may be surprised to learn their VAT number does not validate externally.
If your Spanish customer's NIF does not validate in VIES:
Until 2008, Spanish companies used CIF (Código de Identificación Fiscal) numbers rather than NIF. The CIF format was similar to the current company NIF format. The CIF was replaced by NIF, but many businesses and documents still refer to "CIF" even though technically all tax identification numbers are now NIFs. If someone provides a "CIF," treat it as a NIF—the format and validation are the same.
When validating Spanish VAT numbers through VIES, successful validation returns company name and address. Unlike Germany, Spain provides full details for registered businesses.
Remember that a failed validation does not necessarily mean the number is fake or the business does not exist. It often means the business simply has not registered for intra-community trade. The distinction matters for how you handle the situation with your customer.
For reference when applying reverse charge:
The Canary Islands, Ceuta, and Melilla have separate tax regimes (IGIC and IPSI respectively) rather than standard Spanish VAT.