Spanish postal codes were introduced on 1 July 1984, when the introduced automated mail sorting. They consist of five numerical digits, where the first two digits, ranging 01 to 52, correspond either to one of the 50 provinces of Spain or to one of the two autonomous cities on the African coast.

Two-digit prefixes

thumb|Two-digit postcode areas

The first two digits of a Spanish postal code identify the province or autonomous city it belongs to. The numbers were assigned to the 50 provinces of Spain ordered alphabetically at the time of implementation.

The list below includes all 52 two-digit prefixes assigned to the 50 provinces and two autonomous cities. Included in brackets are the names of the provinces that were used for alphabetical sorting at the time of implementation, if different from the current name used in English.

  • 01 Álava
  • 02 Albacete
  • 03 Alicante
  • 04 Almería
  • 05 Ávila
  • 06 Badajoz
  • 07 Balearic Islands ()
  • 08 Barcelona
  • 09 Burgos
  • 10 Cáceres
  • 11 Cádiz
  • 12 Castellón
  • 13 Ciudad Real
  • 14 Córdoba
  • 15 A Coruña ()
  • 16 Cuenca
  • 17 Girona ()
  • 18 Granada
  • 19 Guadalajara
  • 20 Gipuzkoa ()
  • 21 Huelva
  • 22 Huesca
  • 23 Jaén
  • 24 León
  • 25 Lleida ()
  • 26 La Rioja ()
  • 27 Lugo
  • 28 Madrid
  • 29 Málaga
  • 30 Murcia
  • 31 Navarre ()
  • 32 Ourense ()
  • 33 Asturias ()
  • 34 Palencia
  • 35 Las Palmas ()
  • 36 Pontevedra
  • 37 Salamanca
  • 38 Santa Cruz de Tenerife
  • 39 Cantabria ()
  • 40 Segovia
  • 41 Seville ()
  • 42 Soria
  • 43 Tarragona
  • 44 Teruel
  • 45 Toledo
  • 46 Valencia
  • 47 Valladolid
  • 48 Biscay ()
  • 49 Zamora
  • 50 Zaragoza
  • 51 Ceuta
  • 52 Melilla

Following digits

The third digit of a Spanish postal code is used to identify major cities or basic itineraries. A zero denotes a provincial capital,