Datatypes › Spain › Finances and banking

NIF por nombre de campo

Número de Identificación Fiscal (NIF)

ID nif

DatatypePersonal data (PII)identifier

ES datatype for 'NIF por nombre de campo' (nif) from rules in context 'finances'. The Spanish tax identification number (Número de Identificación Fiscal, NIF) is a unique identifier assigned to individuals and entities for tax purposes in Spain. For individuals, it consists of 8 digits followed by a check letter. For foreigners, it may start with X, Y, Z, K, L, or M followed by 7 digits and a check letter. The total length is 9 characters.

Categories
Finances and banking
Countries
Spain
Languages
Spanish
Google DLP
SPAIN_NIF_NUMBER
Presidio
ES_NIF
Schema.org
taxID
python-stdnum
stdnum.es.nif
Quality
95/100 · missing: negative example
Metacrafter rules
2 rules (1 by field name, 1 by value)
Supported by tools
Amazon Macie, AWS Glue Sensitive Data Detection, Azure AI Language PII detection, Cloudflare DLP, Google Cloud Sensitive Data Protection (DLP), IBM Knowledge Catalog (IBM watsonx.data intelligence), metacrafter, OpenMetadata auto-classification, Microsoft Presidio, python-stdnum

Regular expression

^([0-9]{8}|[XYZKLM][0-9]{7})[TRWAGMYFPDXBNJZSQVHLCKE]$

Python re syntax.

Test a value

Examples

ValueDescription
12345678Z Spanish NIF for a Spanish citizen with 8 digits and check letter
X1234567L Spanish NIF for a foreigner starting with X followed by 7 digits and check letter
87654321X Another valid Spanish NIF format

Translations

LanguageNameDescription
EnglishSpanish Tax Identification Number (NIF)
SpanishNúmero de Identificación Fiscal (NIF)

Sources

Use this record