Datatypes › Spain › Geographic identifiers › postindex

Spanish postal code

ID espostcode

Pattern of postindexPersonal data (PII)categoricalDraft

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).

Postal code (código postal) in Spain: five digits. The first two digits, 01 to 52, identify one of the 50 provinces or the autonomous cities of Ceuta and Melilla. Mexican postal codes are a separate type, mx_postcode.

Pattern of
Postal code/index postindex
Categories
Geographic identifiers
Countries
Spain
Languages
Spanish
FTA
POSTAL_CODE.POSTAL_CODE_ES
python-stdnum
stdnum.es.postal_code
Quality
95/100 · missing: translation
Metacrafter rules
1 rule (1 by field name, 0 by value)
Supported by tools
FTA (Fast Text Analysis), metacrafter, python-stdnum, validator.js

Regular expression

^(?:0[1-9]|[1-4]\d|5[0-2])\d{3}$

Python re syntax.

Test a value

Examples

ValueDescription
07002 Palma, Majorca
27722 Veigas, Asturias
28039
53000 invalid no province 53 (python-stdnum example)

Sources

Use this record