Datatypes › Spain › Person related

Spanish identity document number, masked for publication

ID es_dni_masked

DatatypePersonal data (PII)identifierDraft

This record is a draft: it has not been reviewed yet and may be incomplete or wrong. Do not rely on it for compliance decisions. Help improve it (see CONTRIBUTING.md).

Number of a Spanish identity document (DNI or NIE) with all but four digits replaced by asterisks, as public bodies publish it next to the name of a person. The data protection law (Ley Orgánica 3/2018, seventh additional provision) asks for four digits of the document, and the guidance of the Spanish data protection authorities picks the digits in positions four to seven, so the DNI 12345678X is written ***4567** and the NIE L1234567X is written ****4567*. The guidance is a recommendation, and registers of contracts and grants also show other positions.

Parent datatype
Spanish national identity document number (DNI) es_dni
Categories
Person related, Personally identifiable information
Countries
Spain
Languages
Common to most languages
Quality
90/100 · missing: mapping (Wikidata, Schema.org, ...)
Metacrafter rules
1 rule (0 by field name, 1 by value)
Supported by tools
metacrafter

Regular expression

^(?:\*{3}\d{4}\*{2}|\*{4}\d{4}\*)$

Python re syntax.

Test a value

Examples

ValueDescription
***4567** the DNI 12345678X of the guidance
****4567* the NIE L1234567X of the guidance
12345678X invalid not masked

Translations

LanguageNameDescription
SpanishDNI o NIE anonimizado para su publicación
RussianНомер документа DNI/NIE

Sources

Use this record