San Lorenzo de El Escorial (Madrid): population and map

San Lorenzo de El Escorial is a municipality in the province of Madrid (Comunidad de Madrid), Spain. It has 18,971 inhabitants according to the municipal register of January 1, 2026, spread over 56 km²: 336 inhabitants per square kilometre.

Facts

Population
18,971 inhabitants (January 1, 2026)
Area
56 km²
Density
336 inh./km²
Altitude
1,041 m The altitude is that of its main settlement, not of the whole municipal area.
Province
Madrid
Autonomous community
Comunidad de Madrid
Coast
Inland
INE code
28131

How it compares

  • It ranks 39 by population among the 179 municipalities of the province of Madrid.
  • In Comunidad de Madrid it ranks 39 of 179, and in Spain 462 of 8132.
  • It holds 0.3% of the inhabitants of the province of Madrid.
  • Its density, 336 inh./km², is 0.4 times that of its province (893 inh./km²) and 3.4 times that of Spain (98 inh./km²).
  • By area it ranks 40 of the 179 municipalities of Madrid.
  • By altitude it ranks 34 of the 179 municipalities of Madrid that have a figure.

Municipalities of a similar size in Madrid

Neighbouring municipalities (5)

Map of the municipal area

Simplified outlines; the distance and direction to each neighbour are measured between points inside each municipal area.

Get to know San Lorenzo de El Escorial

San Lorenzo de El Escorial es un municipio y localidad de España, en la Comunidad de Madrid. Se encuentra en el noroeste de la Comunidad, en la vertiente suroriental de la sierra de Guadarrama, al pie del monte Abantos y Las Machotas, a 47 km de Madrid. Es cabeza del partido judicial homónimo. Recibe popularmente el nombre de El Escorial de Arriba, para diferenciarlo del vecino pueblo de El Escorial, que, por su parte, es designado como El Escorial de Abajo.

History

La historia de San Lorenzo de El Escorial se vincula con la construcción del monasterio homónimo y la villa de El Escorial, de la que surgió como segregación. Las primeras referencias históricas de este edificio datan del año 1558, cuando Felipe II designó una comisión para que buscase un lugar idóneo para su emplazamiento, integrada por arquitectos, médicos y canteros, entre otros gremios.

Source: Wikipedia (the article «San Lorenzo de El Escorial» of the Spanish Wikipedia, revision of October 13, 2026) · Licence CC BY-SA 4.0. Shortened excerpts of the article, in Spanish. You may reuse them under the same licence, citing the source.

Read more on Wikipedia

In the game

How many towns of Spain do you recognise by their outline? Try today’s challenge.

Where the figures come from

  • Population: municipal register at January 1, 2026.
  • Area, outline and neighbours: municipal boundary lines.
  • Altitude: that of the main settlement, according to the IGN.
  • Summary and history: the Spanish Wikipedia.

How each figure is calculated

All the municipalities of Madrid