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

Request a personalized quote

Interested in the full database? Ask for a quote.

Our pricing model depends on a few factors such as products, features, use case and country coverage.

Get in touch to receive an accurate pricing proposal.

Annual licenses are priced based on the number of countries needed, type of usage, products and the features (additional datasets).

Our licenses have a fixed price and include everything: comprehensive location data, unlimited updates, the right to use our data in all your systems or products, and continuous support from a dedicated expert.

Data is updated weekly, but you can decide on your own update frequency depending on your use case. You can get automatic differential updates and a list of historical ID changes by using our download API.

124 of the Fortune 500 rely on our international data

Our location dataset for Spain

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.

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.

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 Data

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

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)

Population Database

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

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

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