vatverify home
Spain

Check Spain VAT numbers

Validate Spanish VAT numbers (NIF) against the EU VIES registry. Spanish numbers are 11 characters: the ES prefix, one alphanumeric character, 7 digits, and a trailing alphanumeric check character. The format accommodates DNI (individuals), CIF (companies), and NIE (foreigners). Every response includes the company name, registered address, and validity at query time.

EU member stateNIF Impuesto sobre el Valor AñadidoEUR

Try it

curl -X POST "https://api.vatverify.dev/v1/validate" \  -H "Authorization: Bearer $VATVERIFY_KEY" \  -H "Content-Type: application/json" \  -d '{"vat_number":"ESA28004885"}'
Loading reliability...

Facts

Format

Prefix
ES
Digits
9
Regex
^ES[A-Z0-9]\d{7}[A-Z0-9]$
ValidESA28004885
Bad checksumESA28004880
Bad formatESA2800488

Registry

VIES powers /v1/validate for Spain.

VAT rates (EUR)

21%
Standard
10%
Reduced

transport, hospitality, restaurants, cultural events

4%
Reduced

food staples (bread, milk, eggs), books, newspapers, medicines

What we return for Spain

{
  "data": {
    "valid": true,                       // boolean validity at query time
    "vat_number": "DE129273398",
    "country": {
      "code": "DE",
      "name": "Germany",
      "vat": { "standard_rate": 19 }
    },
    "company": {
      "name": "SIEMENS AG",              // legal entity name
      "address": "..."                    // when VIES provides it
    },
    "verified_at": "2026-04-25T10:00:00Z"
  },
  "meta": {
    "request_id": "019dc...",            // for audit trail correlation
    "source": "vies",
    "source_status": "live",             // live | cached | degraded
    "cached": false,
    "latency_ms": 234
  }
}

Watch out for

  • The first and last characters of an ES NIF are alphanumeric (not always digits). A validator expecting ES + 9 digits will reject valid company NIFs.
  • DNI (individuals), CIF (companies, formerly), and NIE (foreign nationals) all map to the same ES + 1 char + 7 digits + 1 char format.
  • VIES may not disclose company names for individual-taxpayer ES numbers (privacy rules). Validity is still returned.

NIF, CIF, NIE: one identifier, three names

Spain uses a single tax identifier called the Número de Identificación Fiscal (NIF). Historically, legal entities had a CIF (Código de Identificación Fiscal) and individuals had a NIF; the AEAT (Agencia Tributaria) merged the two into "NIF" in 2008. Old documentation and even some modern Spanish tax forms still use "CIF" informally for company NIFs.

For non-resident individuals, the equivalent is the NIE (Número de Identidad de Extranjero), a NIF-shaped identifier that begins with X, Y, or Z.

The EU-facing form prefixes the NIF with ES. All three identifier types route through VIES with the country prefix.

Format: leading or trailing letter

The Spanish NIF for a legal entity is 9 characters: a leading letter, 7 digits, and a trailing alphanumeric check character. The leading letter encodes the entity type (A for sociedades anónimas, B for limited liability, J for civil associations, etc.).

Individual NIFs use 8 digits followed by a check letter. NIE numbers swap the leading position for X, Y, or Z.

vatverify accepts all three structural forms and routes any of them through VIES. The check character is computable offline; structurally invalid inputs are rejected before the registry call.

Name disclosure suppressed

Spain is one of the member states that suppress trader name and address through VIES under national privacy policy. A valid: true response will typically come back with data.company.name and data.company.address set to null for ES numbers.

For B2B onboarding flows that need to confirm identity (not just existence), the workaround is the same as for Germany: ask the counterparty for their company details and reconcile separately. Spain does not currently expose a BZSt-equivalent qualified confirmation API; the registry-level confirmation is what VIES returns.

Canary Islands, Ceuta, Melilla: outside the IVA zone

Three Spanish territories sit outside the EU VAT zone:

  • Canary Islands: use IGIC (Impuesto General Indirecto Canario), not IVA. Standard rate is set by the regional government (currently in single digits, well below mainland IVA).
  • Ceuta and Melilla: use IPSI (Impuesto sobre la Producción, los Servicios y la Importación), a local consumption tax with even lower headline rates.

A Spanish business domiciled in any of these three territories will still have an ES-prefixed NIF and will appear in VIES, but the underlying tax regime is different. Supplies to a Canary Islands buyer are not intra-Community supplies under EU VAT law; they are exports outside the customs territory of EU VAT.

The data.company.address field, when populated, is what tells you which side of the regime boundary the customer sits on. For tax engines this is one of the load-bearing fields.

IVA rates

Mainland Spain runs three IVA rates: 21% standard, 10% reduced, and 4% super-reduced. The super-reduced bracket covers a narrow set of goods (basic foodstuffs, books, certain pharmaceutical products).

Recent years have seen temporary reductions on energy and on basic foods to address inflation. These have been adjusted multiple times, so any rate hardcoded into invoicing logic needs to be a date-aware lookup against current AEAT publications, not a constant.

Caching against the AEAT cycle

AEAT pushes registration changes to VIES on a regular batch cadence. A newly-registered Spanish entity is generally visible in VIES within 24 to 48 hours. The default vatverify TTLs (30 days for valid, 24 hours for invalid) work cleanly with that cadence; an invalid response that flips to valid the next day is the typical signal of an overnight AEAT push.

Loading FAQ…

Automate Spain VAT checks in your stack

Replace manual lookups with one API call against VIES. Drops into invoicing, checkout, and signup flows in any language. 500 free validations per month, no credit card.