Spain Administrative Divisions

What is the hierarchy of administrative divisions in Spain?

Spain operates on a 4‑level system starting with 19 autonomous communities, then provinces, after that regions, and municipalities as the smallest administrative units.

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.

isocountryadmin level 1admin level 2admin level 3admin level 4
ESSpainAndalusia (Autonomous Community)8 Provinces65 Regions786 Municipalities
ESSpainAragon (Autonomous Community)3 Provinces37 Regions734 Municipalities
ESSpainBalearic Islands (Autonomous Community)1 Province10 Regions67 Municipalities
ESSpainBasque Country (Autonomous Community)3 Provinces21 Regions256 Municipalities
ESSpainCanary Islands (Autonomous Community)2 Provinces8 Regions88 Municipalities
ESSpainCantabria (Autonomous Community)1 Province10 Regions103 Municipalities
ESSpainCastille and Leon (Autonomous Community)9 Provinces72 Regions2298 Municipalities
ESSpainCastille-La Mancha (Autonomous Community)5 Provinces35 Regions921 Municipalities
ESSpainCatalonia (Autonomous Community)4 Provinces46 Regions948 Municipalities
ESSpainCeuta (Autonomous City)1 ProvinceThis level doesn’t exist for this country.1 Municipality
ESSpainExtremadura (Autonomous Community)2 Provinces27 Regions388 Municipalities
ESSpainGalicia (Autonomous Community)4 Provinces53 Regions313 Municipalities
ESSpainLa Rioja (Autonomous Community)1 Province12 Regions175 Municipalities
ESSpainMadrid (Autonomous Community)1 Province6 Regions181 Municipalities
ESSpainMelilla (Autonomous City)1 ProvinceThis level doesn’t exist for this country.1 Municipality
ESSpainMurcia (Autonomous Community)1 Province12 Regions45 Municipalities
ESSpainNavarre (Autonomous Community)1 Province17 Regions288 Municipalities
ESSpainPrincipality of Asturias (Autonomous Community)1 Province9 Regions78 Municipalities
ESSpainValencian Community (Autonomous Community)3 Provinces35 Regions542 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

GeoPostcodes - Ecotransit logo
“GeoPostcodes’ global ZIP codes allow us to determine distances accurately. Thanks to their up-to-date database, we no longer have problems with missing locations, making our system much more efficient and reliable.”

Anjo Grebe

Consultant

“GeoPostcodes databases provide IATA codes, enhanced UNLOCODEs with port terminal data, addresses, and more – all on a global scale! This level of accuracy is essential for our mileage and CO2 emissions calculation.”
GeoPostcodes - Peter Wild CarbonCare

Dr. Peter Wild

Managing Partner

“GeoPostcodes’ Population data shows population forecasts over the next years. We can use it as a proxy to justify longer-term changes and downgrade postal code areas in terms of economic viability.”

Kousha Mazloumi

Director of Data Science

“The concept of the city receives different names or belongs to different hierarchical levels depending on the country. Using GeoPostcodes’ data gave us access to city definitions aligned with our customers’ expectations, saving us computation time.”

Kousha Mazloumi

Director of Data Science

GeoPostcodes - Logo_DB_Schenker
“The world is constantly changing. New localities and neighborhoods open up or become dispersed. It’s good to know that GeoPostcodes is keeping on top of those changes and providing us with updated information to work with.”
GeoPostcodes-GeoPostcodes-William chao picture

William Chao

Product Owner of Geographic Information Services

GeoPostcodes - Bark Logo
“The key aspect of working with GeoPostcodes has been their ability to provide customized data solutions. Their collaborative approach has made them an excellent partner in addressing our location data challenges.”

Kate Kilby

Senior Product Manager

GeoPostcodes - Opterrix-logo
“GeoPostcodes’ multi-level boundaries were perfectly aligned, enabling seamless integration with multiple secure cloud platforms. Our software can now provide more accurate visualizations for risk analysis and natural hazard monitoring.”

Dave Hamm

Project Manager

“Countries like Brazil or China are particularly strict with their customs validation. GeoPostcodes’ ZIP codes and Enhanced UNLOCODES database are aligned with national regulations, ensuring seamless transportation and compliance.”
GeoPostcodes - Kavian Ranjbar

Kavian Ranjbar

Data Governance Specialist

“If you’ve got a business where locations are a big part of it and you’re looking to avoid the large costs that can be involved in using APIs, GeoPostcodes’ on-premise database is definitely worth considering.”
GeoPostcodes-Nick Baugie

Nick Beaugié

Senior Software Engineer

Our location dataset for Spain

Explore our comprehensive collection of Spain ZIP code and administrative data products, designed to meet all your mapping and location intelligence needs.

Spain ZIP Codes

Spain utilizes a five-digit numeric postal code system, locally known as Código postal, with a format of 99999. The first two digits of the Código postal identify the province, and the last three digits specify the postal distribution unit. This system covers the mainland, islands, and autonomous cities.

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 administrative landscape often follows inconsistent regional models and irregular public sources, making it difficult to maintain reliable boundaries. Our standardized postal and administrative boundary data resolves these gaps to ensure complete, coherent geographic coverage.

Spain Address Format

Address conventions differ by country, leading to frequent validation errors and incomplete entries. Our dataset applies Spain correct address format to ensure clean inputs, smoother validation, and reduced delivery mistakes.

Address validation - Spain address validation

Comprehensive Spain ZIP code, city, and address data to verify and correct existing addresses at input, post-entry, or in bulk.

Global Location Databases

Comprehensive location data products serving businesses, and
organizations worldwide with accurate, up-to-date geographic information.

Postal code samples

Postal Code Database

Global dataset containing all administrative divisions, cities and ZIP codes.

Explore postal code database

Key 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 polygons

Boundary Data

A global dataset of polygons representing postal codes and administrative areas.

Explore boundaries database

Key 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)
Los Angeles population map

Population Database

Global population estimates at postal code and administrative level covering a span of 55 years: past, present, and future.

Explore population database

Key features

  • 247 Countries
  • 243K Admin areas
  • 55 year span
  • Yearly updates
  • 645K ZIP codes

Specifications

  • Coverage: International
  • Format: CSV, ASC
Street address dataset

Address Database

International dataset with all administrative areas, cities, streets, and relevant postal codes.

Explore address database

Key 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
Updated: June 1, 2026

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.