Spain
ISO 3166-1 country codes and official ISO 3166-2 subdivisions for Spain. Use them in forms, validation, and CountriesDB integrations.
About Spain codes
Need Spain (ES) for a checkout form, shipping zone, or backend validation? This page summarizes the ISO 3166-1 country codes and official subdivisions developers use with CountriesDB.
This guide lists 69 official ISO 3166-2 subdivisions for Spain. These are the same codes CountriesDB serves through widgets and the Backend Data API.
For production, use the CountriesDB country/subdivision widget or fetch Spain from the Data API and validate codes server-side instead of copying values from this page.
ISO codes
Official subdivisions (69)
Official ISO 3166-2 codes for Spain. Use these values in region/state selects and server-side validation, not informal or marketing region names.
| Code | Name | Type |
|---|---|---|
| ES-C | A Coruña [La Coruña] | province |
| ES-A | Alacant | province |
| ES-AB | Albacete | province |
| ES-AL | Almería | province |
| ES-AN | Andalucía | autonomous community |
| ES-VI | Araba | province |
| ES-AR | Aragón | autonomous community |
| ES-O | Asturias | province |
| ES-AS | Asturias, Principado de | autonomous community |
| ES-AV | Ávila | province |
| ES-BA | Badajoz | province |
| ES-B | Barcelona [Barcelona] | province |
| ES-BI | Bizkaia | province |
| ES-BU | Burgos | province |
| ES-CC | Cáceres | province |
| ES-CA | Cádiz | province |
| ES-CN | Canarias | autonomous community |
| ES-S | Cantabria | province |
| ES-CB | Cantabria | autonomous community |
| ES-CS | Castelló | province |
| ES-CL | Castilla y León | autonomous community |
| ES-CM | Castilla-La Mancha | autonomous community |
| ES-CT | Catalunya [Cataluña] | autonomous community |
| ES-CE | Ceuta | autonomous city in North Africa |
| ES-CR | Ciudad Real | province |
| ES-CO | Córdoba | province |
| ES-CU | Cuenca | province |
| ES-PV | Euskal Herria | autonomous community |
| ES-EX | Extremadura | autonomous community |
| ES-GA | Galicia [Galicia] | autonomous community |
| ES-SS | Gipuzkoa | province |
| ES-GI | Girona [Gerona] | province |
| ES-GR | Granada | province |
| ES-GU | Guadalajara | province |
| ES-H | Huelva | province |
| ES-HU | Huesca | province |
| ES-PM | Illes Balears [Islas Baleares] | province |
| ES-IB | Illes Balears [Islas Baleares] | autonomous community |
| ES-J | Jaén | province |
| ES-LO | La Rioja | province |
| ES-RI | La Rioja | autonomous community |
| ES-GC | Las Palmas | province |
| ES-LE | León | province |
| ES-L | Lleida [Lérida] | province |
| ES-LU | Lugo [Lugo] | province |
| ES-M | Madrid | province |
| ES-MD | Madrid, Comunidad de | autonomous community |
| ES-MA | Málaga | province |
| ES-ML | Melilla | autonomous city in North Africa |
| ES-MU | Murcia | province |
| ES-MC | Murcia, Región de | autonomous community |
| ES-NA | Nafarroa | province |
| ES-NC | Nafarroako Foru Komunitatea | autonomous community |
| ES-OR | Ourense [Orense] | province |
| ES-P | Palencia | province |
| ES-PO | Pontevedra [Pontevedra] | province |
| ES-SA | Salamanca | province |
| ES-TF | Santa Cruz de Tenerife | province |
| ES-SG | Segovia | province |
| ES-SE | Sevilla | province |
| ES-SO | Soria | province |
| ES-T | Tarragona [Tarragona] | province |
| ES-TE | Teruel | province |
| ES-TO | Toledo | province |
| ES-V | València | province |
| ES-VC | Valenciana, Comunitat | autonomous community |
| ES-VA | Valladolid | province |
| ES-ZA | Zamora | province |
| ES-Z | Zaragoza | province |
Frequently asked questions
- What is the ISO 3166-1 code for Spain?
- Spain uses ISO 3166-1 alpha-2 ES, alpha-3 ESP, and numeric 724. These codes show up in forms, shipping, banking, and APIs.
- How many official ISO 3166-2 subdivisions does Spain have?
- CountriesDB lists 69 official ISO 3166-2 subdivisions for Spain (states, provinces, regions, or equivalent). Use them when you validate region selects and shipping zones.
- How do I use Spain country and subdivision data in a form?
- Use the CountriesDB widget or Data API to fill country and subdivision selects for Spain, then validate submitted codes with the Validation API so alpha-2 and ISO 3166-2 values stay consistent.
Use Spain in your app
Add CountriesDB country and subdivision selects with the widget docs, or call the Backend Data API for Spain (ES) and validate submissions with the Validation API. Guides stay in sync with the same dataset your project keys already use. widget docs.