---
id: "esvat"
kind: "datatype"
status: "stable"
is_pii: true
categories: ["finances"]
country: ["ES"]
langs: ["es"]
quality: 100
url: "http://registry.apicrafter.io/datatype/esvat"
---

# Spanish intra-Community VAT number (NIF-IVA) (`esvat`)

NIF-IVA, the Spanish VAT number for intra-Community trade: ES followed by the 9-character tax identification number (NIF). Spanish citizens use their DNI, eight digits and a check letter. Foreigners use their NIE, which starts with X, Y or Z. Companies and other entities have a NIF that starts with a letter for the legal form (formerly the CIF). The last character is a check digit or a check letter.

- Parent datatype: `vatin`
- Personal data (PII): yes
- Categories: Finances and banking (finances)
- Countries: Spain (ES)
- Languages: Spanish (es)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^ES(?:[A-Z]\d{7}[A-Z0-9]|\d{8}[A-Z])$
```

## Examples

- `ESB64717838` — Company, python-stdnum reference value
- `ES54362315K` — Resident person (DNI), python-stdnum reference value
- `ESX5253868R` — Foreign person (NIE), python-stdnum reference value
- `ES543623150` (invalid example) — The first or the last character must be a letter
- `ESB6471783` (invalid example) — One character short

## Mappings

- fta: `IDENTITY.VAT_ES`
- schema_org: `vatID`
- stdnum: `es.nif`

## Metacrafter rules

2 rules: 1 match the field name, 1 match values.

- `esvatfield` (field, `es/es_tax.yaml`)
- `esvatvalue` (data, `es/es_tax.yaml`)

## Supported by tools

- `awsglue`
- `fta`
- `metacrafter`
- `pythonstdnum`

## Translations

- es: Número de identificación fiscal a efectos del IVA (NIF-IVA)

## Sources

- wikipedia: <https://es.wikipedia.org/wiki/N%C3%BAmero_de_identificaci%C3%B3n_fiscal>
- doc: <https://www.agenciatributaria.gob.es/AEAT.internet/Inicio/Ayuda/Modelos__Procedimientos_y_Servicios/Comun/Informacion_General/Numero_de_Identificacion_Fiscal_NIF_/Numero_de_Identificacion_Fiscal_NIF_.shtml>
- other: <https://arthurdejong.org/python-stdnum/doc/2.2/stdnum.es.nif.html>

## Quality

Score 100/100.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/esvat.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/ES/finances/esvat.yaml>
