Spain’s largest, smallest, highest and lowest municipality

Madrid has the most people and Torremontalbo the fewest. Cáceres is the biggest by area, Valdelinares the highest. The figures, with sources and caveats.

“The biggest” can mean four things: most people, most land, highest or densest. Here are the answers using data from the INE (population, on 1 January 2026) and the IGN (area and altitude), and what each one leaves out.

Most and fewest inhabitants

Most populated: Madrid, with 3,486,621 inhabitants. Barcelona has 1,729,553, half as many. València, third, has 850,520. Only 69 municipalities have more than 100,000.

Least populated: Torremontalbo, in La Rioja, with 4 inhabitants. Next come Villanueva de Gormaz (Soria) with 5, and Torremochuela (Guadalajara) and Illán de Vacas (Toledo) with 6.

Most and least land

The area comes from the IGN boundary lines, calculated on the GRS80 ellipsoid.

MunicipalityArea
LargestCáceres1,750.23 km²
SecondLorca (Murcia)1,675.27 km²
ThirdBadajoz1,440.66 km²
SmallestLlocnou de la Corona (Valencia)0.01 km²
Second smallestEmperador (Valencia)0.03 km²
Third smallestMaleján (Zaragoza)0.08 km²

With a figure of 0.01 km² the rounding matters: it means between 5,000 and 15,000 square metres. Llocnou de la Corona has 140 inhabitants in that space.

Highest and lowest

Here is a catch: the altitude of a municipality is not one number. A municipal area has peaks and valleys. What we use is the altitude of its capital, the settlement where the town hall is, according to the IGN population data (the most populated settlement, if none is marked as capital).

  • Highest: Valdelinares (Teruel), at 1,685 m. Then Griegos (1,602 m), Gúdar (1,588 m) and Bronchales (1,570 m), all in Teruel.
  • Lowest: Melilla and Roses (Girona), at 2 m. Another 19 municipalities are at 3 m, such as Arrecife (Las Palmas), Castelldefels (Barcelona) or Limpias (Cantabria).

Five municipalities have no altitude in that source: Capolat, Fogars de la Selva, Malla and La Quar (Barcelona) and Hermigua (Santa Cruz de Tenerife). They are left out of the ranking.

Densest and sparsest

Density is inhabitants per square kilometre. The average for Spain, adding all municipalities, is 98.2 inhabitants per km². The extremes:

  • Densest: Mislata (Valencia), with 23,171 inhabitants per km² in 2.04 km². Next are L'Hospitalet de Llobregat (21,951) and Santa Coloma de Gramenet (17,442). Sixteen municipalities have less than 1 km², with the area rounded to two decimals: their density has a margin that the density of these three does not, so we do not rank them.
  • Sparsest: Valdeprado (Soria), with 0.22 inhabitants per km² (7 people in 31.92 km²), and Villanueva de Gormaz (Soria), with 0.23.

Where to see each one

The full lists are on the municipalities page, with the extremes of Spain, and on the page of each province: Teruel, Soria or Valencia.

How we calculated it

Every figure comes from the same dataset the game uses. If two municipalities tie, the one with the lower INE code goes first. The method page explains each calculation, and the source of each datum is above.

Frequently asked questions

What is the most populated municipality in Spain?

Madrid, with 3,486,621 inhabitants in the register of 1 January 2026. Barcelona follows with 1,729,553.

What is the municipality with the fewest inhabitants?

Torremontalbo (La Rioja), with 4 inhabitants in that same table. Villanueva de Gormaz (Soria) has 5.

What is the highest municipality in Spain?

Valdelinares (Teruel), at 1,685 metres in the settlement that is its capital, according to the IGN population data. The altitude of a whole municipality varies more than that of its village.

Sources