Postal code
Spain postal codes
Spain postal codes have the format ##### (5 digits), for example 28039. zipcodestack has 38,347 postal codes for Spain in 19 regions.
- Format
- #####
- Example
- 28039
- Codes in our database
- 38,347
- Local name
- código postal
Spain postal code format
| Pattern | ##### (# digit, @ letter) |
|---|---|
| Examples | 28039, 28300, 28070 |
| Regex | ^(?:\d{5})$ |
| Official lookup | www.correos.es |
Format and regex from Google's address metadata (libaddressinput). The regex checks the shape of a code, not whether it exists.
Postal Codes by region
| Region | Range | Codes |
|---|---|---|
| Andalucia | 04001 – 41989 | 1,237 |
| Aragon | 22001 – 50840 | 767 |
| Asturias | 33001 – 33997 | 420 |
| Baleares | 07001 – 07872 | 164 |
| Canarias | 35001 – 38917 | 368 |
| Cantabria | 33554 – 39880 | 215 |
| Castilla - La Mancha | 02001 – 45960 | 866 |
| Castilla - Leon | 01118 – 49882 | 2,020 |
| Cataluna | 08001 – 43897 | 1,163 |
| Ceuta | 51001 – 51080 | 8 |
| Comunidad Valenciana | 03001 – 46989 | 657 |
| Extremadura | 06001 – 13110 | 466 |
| Galicia | 15001 – 36995 | 1,540 |
| La Rioja | 26001 – 26589 | 132 |
| Madrid | 28001 – 28991 | 323 |
| Melilla | 52001 – 52080 | 9 |
| Murcia | 03657 – 30893 | 213 |
| Navarra | 31001 – 50686 | 266 |
| Pais Vasco | 01001 – 48998 | 333 |
Postal Codes of the largest cities
Madrid
28001 + 62 more
Barcelona
08001 + 45 more
Valencia
46001 + 29 more
Zaragoza
50001 + 26 more
Sevilla
41001 + 23 more
Málaga
29001 + 25 more
Murcia
30001 + 20 more
Palma
07001 + 29 more
Las Palmas de Gran Canaria
35001 + 23 more
Alicante
03001 + 23 more
Bilbao
48001 + 17 more
Córdoba
14001 + 18 more
Valladolid
47001 + 23 more
Vigo
36201 + 32 more
Gijón
33200 + 18 more
Gasteiz / Vitoria
01001 + 24 more
L'Hospitalet de Llobregat
08001 + 28 more
A Coruña
15001 + 11 more
Elche
03200 + 15 more
Granada
18001 + 19 more
Ciudad Lineal
28001 + 43 more
Oviedo
33001 + 16 more
Terrassa
08220 + 8 more
Badalona
08910 + 8 more
Cartagena
30200 + 9 more
Jerez de la Frontera
11401 + 14 more
Sabadell
08200 + 9 more
Santa Cruz de Tenerife
38001 + 18 more
Pamplona
31001 + 32 more
Móstoles
28930 + 8 more
Neighbouring countries
Spain postal codes: FAQ
What is the postal code format in Spain?
Spain postal codes follow the pattern
##### (# = digit, @ = letter), i.e. 5 digits. Examples: 28039, 28300, 28070.What regex validates Spain postal codes?
^(?:\d{5})$ matches the official format (from Google's address metadata). It checks the shape only; whether a code exists needs a lookup in a postal code database such as the zipcodestack API.What is the postal code of Madrid?
Madrid has 63 postal codes, starting with 28001. The right one depends on the street; see the full list for Madrid.
How many postal codes are there in Spain?
The zipcodestack database contains 38,347 postal codes for Spain, each with place name, region and coordinates.
Postal code API
Look up Spain postal codes by API
zipcodestack looks up, validates and searches postal codes in 149 countries: city, state, coordinates, distances and radius search, as JSON.
/v1/search documentation International postal code API All documentation
300 free requests every month. No credit card required.
GET https://api.zipcodestack.com/v1/search?codes=28039&country=es
{
"results": {
"28039": [{
"postal_code": "28039",
"country_code": "ES",
"city": "…",
"state": "…",
"latitude": …,
"longitude": …
}]
}
}Free postal code tools
Bulk ZIP code lookup
City and coordinates for a list.
Distance between ZIP codes
Miles or km between ZIP codes.
ZIP codes in a drawn area
Draw an area, get its codes.
What is my ZIP code?
Find the ZIP code where you are.
ZIP code radius search
All codes within X miles of a code.
Postal code validator
Is this postal code real?
Postal codes by countryFormats, regions and cities for 149 countries.