Map from Google - Spain

In Spain the climate is generally temperate, however, we can distinguish among five types of climate: the climate of the Atlantic coast, cool, humid and rainy; the climate of the central plateau, quite arid and moderately continental, with relatively cold winters and hot summers (see Madrid); the Mediterranean climate of the southern and eastern coastal regions (see Barcelona, Malaga), mild and sunny; the mountain climate of the Pyrenees and the Sierras, more or less cold depending on altitude; and finally the almost African climate of Andalusia, mild in winter and very hot in summer. Therefore, Spain is not always warm and sunny as you might think.

Winter is mild and humid on the coast bordering the Atlantic Ocean (see La Coruna, Gijon, Santander, Bilbao): rainfall is frequent and sunshine is relatively rare. The coasts of Galicia and Asturias, more exposed to the westerly winds, are often windy. In Galicia (see Vigo), the rainfall is particularly abundant, especially from October to April.
Here are the average temperatures of Santander.
Average temperatures - Santander
SantanderJanFebMarAprMayJunJulAugSepOctNovDec
SantanderJFMAMJJASOND
Min (°C)88910121517181614119
Max (°C)131315161820232322201614
Min (°F)464648505459636461575248
Max (°F)555559616468737372686157

In this northern area, the rains are abundant, and some rain may fall even in summer. In Santander, more than 1,100 mm (43 in) of rain per year fall. Here is the average rainfall in Santander.
Average precipitation - Santander
SantanderJanFebMarAprMayJunJulAugSepOctNovDecYear
SantanderJFMAMJJASONDY
Prec. (mm)110858510075605070901151551251115
Prec.(in)4.33.33.33.932.422.83.54.56.14.943.9
Days131110121198910121013127

In the coast of the Mediterranean Sea and in the small Atlantic coastline of the Gulf of Cádiz (see Barcelona, Valencia, Balearic Islands, Almeria, Malaga, Cádiz, Jerez de la Frontera), winter is mild, but in comparison with the northern coast the rains are more rare and sunshine is more frequent. This is due to the fact that the Mediterranean coasts of Spain, exposed as they are to the east and south, are relatively sheltered from Atlantic weather fronts.
Here are the average temperatures of Barcelona, located in the north-eastern part of the Mediterranean coast.
Average temperatures - Barcelona
BarcelonaJanFebMarAprMayJunJulAugSepOctNovDec
BarcelonaJFMAMJJASOND
Min (°C)557913172020171496
Max (°C)141416182125282926221714
Min (°F)414145485563686863574843
Max (°F)575761647077828479726357

While in Barcelona the average temperature in January is about 8 °C (46.5 °F), continuing to the south it becomes milder, and already in Valencia it exceeds 10 °C (50 °F). In Barcelona, the rains are not abundant, and residents are asked not to waste water. Here is the average precipitation.
Average precipitation - Barcelona
BarcelonaJanFebMarAprMayJunJulAugSepOctNovDecYear
BarcelonaJFMAMJJASONDY
Prec. (mm)4040354055302065851006540620
Prec.(in)1.61.61.41.62.21.20.82.63.33.92.61.624.4
Days44555425575556

Continuing south on the east coast, precipitation becomes even more scarce. In Alicante, just 285 mm (11.2 in) of rain fall each year. Here is the average precipitation in Alicante.
Average precipitation - Alicante
AlicanteJanFebMarAprMayJunJulAugSepOctNovDecYear
AlicanteJFMAMJJASONDY
Prec. (mm)2020203030104540453525285
Prec.(in)0.80.80.81.21.20.40.20.21.61.81.4111.2
Days43344211444437

In the most sheltered areas such as Almeria, which are protected by the Sierra Nevada, even winter is relatively dry and sunny, so the climate of these areas becomes semi-desert, and this happens also in Los Monegros, between Zaragoza and Lleida, where the movies called "spaghetti Western" were shot.
In the Balearic Islands (Mallorca, Menorca, Ibiza, Formentera), which have a Mediterranean climate, but are also quite windy, the easternmost one, Menorca, is also the windiest, because of the cool wind blowing at times from southern France, while Ibiza and Formentera, located more to the south, are milder and more sheltered. However, summer is hot and sunny in all the islands.
Average temperatures - Ibiza
IbizaJanFebMarAprMayJunJulAugSepOctNovDec
IbizaJFMAMJJASOND
Min (°C)88910131720211915119
Max (°C)151517182226292927231916
Min (°F)464648505563687066595248
Max (°F)595963647279848481736661

The interior of Spain (see Valladolid, León, Pamplona, Madrid, Salamanca, Zaragoza), is largely occupied by a plateau, called Meseta, which has an average altitude of 700/800 metres (2,300/2,600 feet), and has colder winters. In this plateau, precipitation is not abundant, because the bulk of the moisture is discharged on the Atlantic slopes, however during winter it is quite frequent.

Madrid

In Madrid, located at the centre of the plateau, at 650 metres (2,100 ft) above sea level, in January the nighttime temperatures hover around freezing (0 °C or 32 °F), while the daytime temperatures are around 10 °C (50 °F), but sometimes during cold spells it can freeze and snow. Precipitation amounts to 455 mm (18 in) per year. Here are the average temperatures.
Average temperatures - Madrid
MadridJanFebMarAprMayJunJulAugSepOctNovDec
MadridJFMAMJJASOND
Min (°C)13461014181714953
Max (°C)101216182228323227201411
Min (°F)343739435057646357484137
Max (°F)505461647282909081685752

In the mountain regions the climate becomes progressively more cold and snowy with increasing altitude; in addition, at the same altitude the Pyrenees in the north are certainly colder than the Sierra Nevada, but the latter is higher (Mount Mulhacen reaches nearly 3,500 metres or 11,500 ft), therefore there is usually enough snow to ski even though it's located at a southern latitude. It is possible to combine a morning's skiing with an afternoon at the coast, to enjoy the balmy air of the nearby Costa Tropical.
There is also a mountainous range that crosses the Meseta, which is called Central System, and is divided into various chains; the one closest to the capital is Sierra de Guadarrama, whose highest peak is Peñalara (2,428 metres or 7,966 feet), and where you can ski in winter, while to the south-west we find another chain, Sierra de Gredos, also at no great distance from Madrid.
Here are the average temperatures of Puerto de Navacerrada, located at 1,858 meters (6,095 ft) above sea level. Here the landscape is green because of the higher precipitation amount, 1,240 mm (49 in) per year, with a maximum between October and December of 160/180 mm (6.3/7.1 in) per month, and a minimum in July and August of 25 mm (1 in) per month.
Average temperatures - Navacerrada
NavacerradaJanFebMarAprMayJunJulAugSepOctNovDec
NavacerradaJFMAMJJASOND
Min (°C)-3-3-10381212840-2
Max (°C)236712182222171163
Min (°F)272730323746545446393228
Max (°F)363743455464727263524337

Summer is cool and quite rainy on the Atlantic coast, where even in July and August the sun is often covered with clouds, and the sea is not warm, barely touching 21 °C (70 °F) in August. The average daily temperature is around 19/20 °C (66/68 °F) in July and August.
In the rest of Spain, summer is hot, dry and sunny.
In the plateau, the days are often torrid, with highs well above 30 °C (86 °F), but thanks to the altitude, nights are pretty cool, and on the other hand, moisture is low, therefore the heat is more bearable. In Madrid, the temperature easily reaches 35/36 °C (95/97 °F), and sometimes even 40 °C (104 °F).
Along the Mediterranean coast and in the Balearic Islands, summer is hot and sunny, as is typically of the Mediterranean climate, the air is humid but sea breezes temper the heat during the day. Therefore, in Barcelona summer is hot and sunny, a little less hot but more humid than Madrid, with occasional thunderstorms during the afternoon.

In the southern inland regions, in southern Extremadura and inland Andalusia, summer is very hot: Seville and Córdoba are actually the hottest city in Europe, and this area is like a piece of Africa in Europe. In summer the temperatures often reach 38/40 °C (100/104 °F), and sometimes even 45 °C (113 °F).
Average temperatures - Seville
SevilleJanFebMarAprMayJunJulAugSepOctNovDec
SevilleJFMAMJJASOND
Min (°C)56911131720201814107
Max (°C)151720242732363632262016
Min (°F)414348525563686864575045
Max (°F)596368758190979790796861

In the southern cities located at hill altitudes, such as Granada, located at 700 metres (2,300 feet) above sea level, the heat is tempered by the altitude, and nights are a bit cooler, but the days are often torrid.

Granada, Alhambra

On the north-west coast, the sea is always very cool, if not cold, and reaches a maximum of 19 °C (66 °F) in summer.
Sea temperature - La Coruna
La CorunaJanFebMarAprMayJunJulAugSepOctNovDec
La CorunaJFMAMJJASOND
Sea (°C)131313131416181918171514
Sea (°F)555555555761646664635957

On the north coast (see Bilbao), the temperature of the sea is still very cool, even though it is a bit higher in summer.
Sea temperature - Bilbao
BilbaoJanFebMarAprMayJunJulAugSepOctNovDec
BilbaoJFMAMJJASOND
Sea (°C)131212131518202120181513
Sea (°F)555454555964687068645955

On the coast of the Mediterranean Sea (see Barcelona, Balearic Islands, Costa Blanca), the sea temperature is higher, and it is warm enough for swimming from July to September.
Sea temperature - Barcelona
BarcelonaJanFebMarAprMayJunJulAugSepOctNovDec
BarcelonaJFMAMJJASOND
Sea (°C)131313141720232523201715
Sea (°F)555555576368737773686359

In the Costa del Sol (see Malaga), the sea is less warm than in the rest of the Mediterranean, due to the infiltration of Atlantic waters, while the small portion in the south-west which overlooks the Atlantic Ocean (Costa de la Luz, see Cádiz) is even cooler: here the ocean temperature reaches only 21 °C (70 °F) in August and September, even though the weather is hot and sunny.
Sea temperature - Málaga
MálagaJanFebMarAprMayJunJulAugSepOctNovDec
MálagaJFMAMJJASOND
Sea (°C)161515161720222322201816
Sea (°F)615959616368727372686461


For a beach holiday, the Atlantic coast have cool and fairly rainy summers, and also the ocean temperature is quite cool even in August, so the Mediterranean coast is preferable, especially in July and August.
For those wishing to visit cities and make excursions, summer is a great season on the Atlantic side (north and west), where you can find a cool or mild weather, very different from the rest of Spain. The same can be said with regard to mountainous areas, which are sunny but not too hot.
The rest of Spain during summer is hot, especially in July and August, and the heat can be difficult to bear, at least for those who suffer from the heat. This applies especially to the inland southern areas (see Seville, Córdoba), which are literally on fire, almost an outpost of Africa in Europe.
The southern coasts on the Mediterranean Sea (Costa del Sol, Costa Blanca) have mild and sunny winters, so these areas can be pleasant even in winter. In general, however, the best seasons to visit the southern and central part of Spain are spring and autumn. In Madrid and Barcelona, for example, May, June and September are the best months (though in September, especially in Barcelona, the first autumn rains occur); in Seville, which is characterized by a particularly long and hot summer, the best months are May, October and April, the maximum temperature can already exceed 25 °C (77 °F) with some ease.
For skiing, the snow is more likely in the Pyrenees than in the mountainous areas of the centre and south. As mentioned you can also ski north of Madrid, in Sierra de Guadarrama, and further south in Sierra Nevada, where ski runs, even though they are located at very high altitudes, above 3,000 metres (10,000 ft), are not always covered with snow, as we have seen some years ago, when the World Ski Championships were postponed to the next year due to lack of snow.

What to pack

In winter: for Madrid and the plateau: warm clothes, sweater, down jacket, raincoat or umbrella. For the northern Atlantic coast and Barcelona: warm clothes, sweater, jacket, raincoat or umbrella. For the south coast: spring/autumn clothes, sweater, jacket, raincoat or umbrella. For high mountains: mountain clothing.

In summer: for the northern Atlantic coast: light clothing, t-shirt, but also jacket, sweatshirt or sweater; raincoat or umbrella. For Madrid and the plateau: light clothing, sun hat, sweatshirt for cool evenings, possibly an umbrella. For Barcelona, the Balearic Islands and the south, light clothes, sun hat, a sweatshirt for the evening in June.
For the mountains, sweatshirt, jacket, hiking shoes, sunscreen and sunglasses.

See also the climate of the Canary Islands.