Countries

    Spain Postal Codes and Addressing Guide

    How Spanish codigos postales and addresses work, from province-based five-digit codes to floor and door notation, and how a UPCS ES code helps.

    Updated 14 October 2026 · 3 min read

    Spain uses a five-digit postal code, the codigo postal, written before the name of the town. The first two digits are tied to the province, which makes the Spanish code easy to read at a glance, and addresses place the street type and name before the number.

    How Spanish postal codes work

    The codigo postal consists of five digits. The first two digits identify the province, numbered alphabetically from 01 to 52, and the last three digits narrow the code to a town, a delivery zone or part of a city. Madrid begins with 28 and Barcelona with 08. The national postal operator is Correos. A province code of 51 and 52 relates to the autonomous cities of Ceuta and Melilla. Details are in Spain postal code format explained.

    How addresses are written

    Spanish addresses start with the street type and name, such as Calle or Avenida, then the number, and then floor and door details before the code and town. The province is often added in brackets after the town. See how to write a Spanish address correctly.

    How UPCS codes work in Spain

    UPCS generates a short code for an exact location on a map. In Spain the code starts with ES, followed by two blocks of letters and digits, for example ES-XXXX-XXXX (placeholder). Each code stands for a 3 m x 3 m grid cell, and the same coordinates always give the same code.

    A UPCS code is not an official postal code and is not issued by Correos or the Spanish government. It does not replace the codigo postal or the street address. It helps a courier, a visitor or a shop open the exact entrance, gate or collection point on a map, which can matter in large apartment blocks, housing estates and rural areas.

    Why the codigo postal alone is not always enough

    A codigo postal identifies a town or a delivery zone, not a door. Housing estates with internal roads, properties without a street number and large apartment blocks mean a courier often needs more than the five digits and the street name. An exact map point can add that detail without changing the official address.

    In this guide

    Postal code format explains the province link and typical values. Address format covers the order of lines and floor and door notation. Finding a codigo postal shows how to look one up. Delivery and addressing challenges looks at urbanisations, missing numbers and co-official languages. Other places are in the countries hub.

    In this guide

    Frequently asked questions

    Is a UPCS code the same as a Spanish codigo postal?

    No. The codigo postal is the official five-digit code used by the postal service. A UPCS code is a separate code for an exact 3 m x 3 m location and is not issued by Correos or any government body.

    What prefix do UPCS codes in Spain use?

    They start with ES, for example ES-XXXX-XXXX in the standard CC-XXXX-XXXX layout.