World Postal Codes > Worldwide Administrative Divisions > Europe Administrative Divisions > Spain Administrative Divisions
Spain Administrative Divisions
What is the hierarchy of administrative divisions in Spain?
Here’s a breakdown of the hierarchy:
1. Autonomous Communities: Spain is divided into 19 autonomous communities.
2. Provinces: Autonomous Communities are subdivided into provinces.
3. Regions: Provinces are further subdivided into regions.
4. Municipalities: These are the smallest administrative units, often found within regions.
List of Spain's administrative divisions with their counts and names
These are the summarized administrative divisions. The full dataset is available in the Download Center.
| iso | country | admin level 1 | admin level 2 | admin level 3 | admin level 4 |
|---|---|---|---|---|---|
| ES | Spain | Andalusia (Autonomous Community) | 8 Provinces | 65 Regions | 786 Municipalities |
| ES | Spain | Aragon (Autonomous Community) | 3 Provinces | 37 Regions | 734 Municipalities |
| ES | Spain | Balearic Islands (Autonomous Community) | 1 Province | 10 Regions | 67 Municipalities |
| ES | Spain | Basque Country (Autonomous Community) | 3 Provinces | 21 Regions | 256 Municipalities |
| ES | Spain | Canary Islands (Autonomous Community) | 2 Provinces | 8 Regions | 88 Municipalities |
| ES | Spain | Cantabria (Autonomous Community) | 1 Province | 10 Regions | 103 Municipalities |
| ES | Spain | Castille and Leon (Autonomous Community) | 9 Provinces | 72 Regions | 2298 Municipalities |
| ES | Spain | Castille-La Mancha (Autonomous Community) | 5 Provinces | 35 Regions | 921 Municipalities |
| ES | Spain | Catalonia (Autonomous Community) | 4 Provinces | 46 Regions | 948 Municipalities |
| ES | Spain | Ceuta (Autonomous City) | 1 Province | This level doesn’t exist for this country. | 1 Municipality |
| ES | Spain | Extremadura (Autonomous Community) | 2 Provinces | 27 Regions | 388 Municipalities |
| ES | Spain | Galicia (Autonomous Community) | 4 Provinces | 53 Regions | 313 Municipalities |
| ES | Spain | La Rioja (Autonomous Community) | 1 Province | 12 Regions | 175 Municipalities |
| ES | Spain | Madrid (Autonomous Community) | 1 Province | 6 Regions | 181 Municipalities |
| ES | Spain | Melilla (Autonomous City) | 1 Province | This level doesn’t exist for this country. | 1 Municipality |
| ES | Spain | Murcia (Autonomous Community) | 1 Province | 12 Regions | 45 Municipalities |
| ES | Spain | Navarre (Autonomous Community) | 1 Province | 17 Regions | 288 Municipalities |
| ES | Spain | Principality of Asturias (Autonomous Community) | 1 Province | 9 Regions | 78 Municipalities |
| ES | Spain | Valencian Community (Autonomous Community) | 3 Provinces | 35 Regions | 542 Municipalities |
Why is building an Administrative Divisions Database complex?
The complexity arises from inconsistent global standards, frequent boundary changes, non-uniform naming conventions (e.g., “suburb” in Australia vs. “county” in the US), and variations in administrative levels across countries. Integrating and harmonizing data from multiple sources requires advanced normalization, versioning, and geospatial validation techniques.
How does GeoPostcodes solve the problem for you?
Our standardized database overcomes the complexity of different administrative division
systems worldwide. Our database follows a unified structure that you can integrate
seamlessly into your system or platform of choice without needing to become an expert in
each country’s unique administrative hierarchy.
Download the complete Dataset
Explore the comprehensive list of administrative divisions, standardized and scalable across 247 countries.
Why choose GeoPostcodes
Global coverage
Complete coverage across 247 countries, including hard-to-source geographies like China, Japan, Brazil, and Russia.
Highest quality
Built on extensive, authoritative sourcing with robust data engineering and quality control. Standardized and up-to-date.
Expert Consulting
With 15 years of experience, we guide your implementation and deliver data in the format that fits your system.
Trusted by industry leaders
Join more than 100 enterprise clients who trust GeoPostcodes for their location data
Anjo Grebe
Consultant


Dr. Peter Wild
Managing Partner

Kousha Mazloumi
Director of Data Science

Kousha Mazloumi
Director of Data Science

William Chao
Product Owner of Geographic Information Services


Kate Kilby
Senior Product Manager

Dave Hamm
Project Manager

Kavian Ranjbar
Data Governance Specialist

Nick Beaugié
Senior Software Engineer
Our location dataset for Spain
Spain ZIP Codes
According to the GeoPostcodes world postal code database, Spain has 10,818 postal codes, 8,681 regions, and 73,291 towns. Similar to US ZIP codes, Spain’s postal codes are entirely numeric, but they differ in length as US ZIP codes are five-digit numeric with an optional four-digit extension, whereas Spanish postal codes are strictly five-digit numeric.
Spain ZIP & Administrative boundaries
Spain Address Format
Address validation - Spain address validation
Global Location Databases
Comprehensive location data products serving businesses, and
organizations worldwide with accurate, up-to-date geographic information.

Postal Code Database
Global dataset containing all administrative divisions, cities and ZIP codes.
Explore postal code databaseKey features
- 247 Countries
- 9,9M Coordinates
- 9,3M Postal Codes
- 400 Time zones
- 4M Cities and Towns
- 116K UNLOCODES
Specifications
- Coverage: Global
- Format: CSV, ASC, DAT, GML, GeoJSON, KML, Shapefile (SHP)

Boundary Data
A global dataset of polygons representing postal codes and administrative areas.
Explore boundaries databaseKey features
- 247 Countries
- Up to 6 levels
- 1,7M boundaries
- High-precision
- 245K Admin areas
- Visualization
Specifications
- Coverage: Global
- Format: GeoJSON, Geopackage, KML, Shapefile (SHP)

Population Database
Global population estimates at postal code and administrative level covering a span of 55 years: past, present, and future.
Explore population databaseKey features
- 247 Countries
- 243K Admin areas
- 55 year span
- Yearly updates
- 645K ZIP codes
Specifications
- Coverage: International
- Format: CSV, ASC

Address Database
International dataset with all administrative areas, cities, streets, and relevant postal codes.
Explore address databaseKey features
- 81 Countries
- 299 languages
- 26,5M streets
- 400 time zones
- 9.3M ZIP codes
- 4M cities
Specifications
- Coverage: International
- Format: CSV, ASC, DAT, GML, KML, Shapefile (SHP), GeoJSON
Global Postal Code Coverage
247 countries and territories with standardized formatting and reliable geographic information.
Related Countries
Frequently Asked Questions
Spain is divided into 17 autonomous communities (Comunidades Autónomas) and 2 autonomous cities (Ciudades Autónomas), which form the top-level administrative units. These are subdivided into 52 provinces (Provincias). At the next level, there are 477 regions (Comarcas). The smallest administrative level consists of 8,131 municipalities (Municipios). Major autonomous communities include Andalusia, Aragon, and Balearic Islands.
Spain has 4 administrative levels. Level 1: 17 autonomous communities (Comunidades Autónomas) and 2 autonomous cities (Ciudades Autónomas). Level 2: 52 provinces (Provincias). Level 3: 477 regions (Comarcas). Level 4: 8,131 municipalities (Municipios).
Spain operates on a 4‑level system starting with 19 autonomous communities, then provinces, after that regions, and municipalities as the smallest administrative units.
In Spain, autonomous communities and autonomous cities both sit at administrative level 1 but serve different functions. Autonomous communities (comunidades autónomas) — there are 17 — typically group multiple smaller municipalities under a shared administration. Autonomous cities (ciudades autónomas) — there are 2 — are a larger city or urban area that handle its own administration independently.
Spanish administrative divisions have specific local names at each level. In Spanish, autonomous communities are called Comunidades Autónomas; autonomous cities are called Ciudades Autónomas; provinces are called Provincias; regions are called Comarcas; municipalities are called Municipios. These local-language terms appear in official documents, legal records, and government databases, so matching them correctly is important for data integration and compliance.
Administrative boundaries in Spain change as governments reorganize regions, merge municipalities, or create new administrative units to reflect population shifts and political decisions. Changes most commonly affect the municipalities level, where Spain currently has 8,131 units. Businesses that rely on Spanish administrative data should use a regularly updated reference dataset to avoid mismatches in geocoding, tax jurisdiction mapping, and compliance reporting.