For anyone new to Spain, have you ever been stumped by the ‘Código Postal’ while on a shopping spree on Amazon? I definitely fell into that trap when I first arrived. I kept entering my address over and over, but the system insisted the postal code was wrong. I almost thought my online shopping days were over—it was so frustrating! After digging into it, I discovered there’s a real method to Spanish postal codes. Today, I’m sharing what I learned to help anyone else facing the same confusion.
What Exactly is a Spanish Postal Code?
The Spanish postal code, or Código Postal, is a sequence of 5 digits. These numbers aren’t random; they contain precise geographical information that directly determines whether your package can be delivered correctly.
Its structure is generally as follows:
- The first two digits: Represent the province. Spain has 50 provinces, and each has its own fixed two-digit code. For example, Madrid is 28, and Barcelona is 08.
- The last three digits: Represent the specific delivery area. Within the same province, these three digits further break down the location to the city, district, or even street level. In large cities like Madrid, a long street might even have different postal codes at each end.
So, get one digit wrong, and your precious package could end up in a completely different town. You can’t just enter a general city-wide postal code like you might in some other countries.

How to Quickly Find Your Correct Postal Code?
Once you understand the logic, finding your code is easy. The most authoritative and recommended method is to use the official Correos (Spanish Post) website. They have a dedicated postal code lookup tool where you just need to enter the province, city, street name, and building number, and the system will give you the precise 5-digit code. This is 100% accurate and recognized by Amazon and all other e-commerce platforms.
Google Maps is also very useful. Simply enter your full address into Google Maps, and the corresponding postal code will usually be displayed in the address details. This method is more visual, and you can even take a look at the Street View for the Spanish postal codes to confirm it’s your front door, haha.
Here are the province codes for a few major cities for your reference, so at least you won’t get the first two digits wrong:
| City | Province Code |
| Madrid | 28 |
| Barcelona | 08 |
| Valencia | 46 |
| Seville | 41 |
| Zaragoza | 50 |
| Málaga | 29 |
One last tip: if you move, be sure to update the default address and postal code on all your online shopping platforms immediately! You don’t want to realize a package was sent to your old address after the fact—that’s a real hassle. Hope all your packages arrive safely! If you have any other questions about life in Spain, feel free to discuss them in the comments!