structural:expansion, information:extraction, quality:correction, structural:summarization
Climate

Madrid has a cold semi-arid climate (Köppen BSk), transitioning to a Mediterranean climate (Csa) in the western half. The city has continental influences.

Winters are cool due to its altitude, which is approximately 667 m (2,188 ft) above sea level and distance from the moderating effect of the sea. While mostly sunny, rain, sporadic snowfalls and frequent frosts can occur between December and February with cooler temperatures particularly during the night and mornings as cold winds blow into the city from surrounding mountains. Summers are hot and sunny, in the warmest month, July, average temperatures during the day range from 32 to 34 °C (90 to 93 °F) depending on location, with maxima commonly climbing over 35 °C (95 °F) and occasionally up to 40 °C during the frequent heat waves. Due to Madrid's altitude and dry climate, humidity is low and diurnal ranges are often significant, particularly on sunny winter days when the temperature rises in the afternoon before rapidly plummeting after nightfall. Madrid is among the sunniest capital cities in Europe.

The highest recorded temperature was on 14 August 2021, with 40.7 °C (105.3 °F) and the lowest recorded temperature was on 16 January 1945 with −10.1 °C (13.8 °F) in Madrid. While at the airport, in the eastern side of the city, the highest recorded temperature was on 24 July 1995, at 42.2 °C (108.0 °F), and the lowest recorded temperature was on 16 January 1945 at −15.3 °C (4.5 °F). From 7 to 9 January 2021, Madrid received the most snow in its recorded history since 1904; Spain's meteorological agency AEMET reported between 50 and 60 cm (20 and 24 in) of accumulated snow in its weather stations within the city.

Precipitation is typically concentrated in the autumn, winter, and spring. It is particularly sparse during the summer, taking the form of about two showers and/or thunderstorms during the season. Madrid is the European capital with the least amount of annual precipitation.

At the metropolitan scale, Madrid features both substantial daytime urban cool island and nighttime urban heat island effects during the summer season in relation to its surroundings, which feature thinly vegetated dry land.