According to the Köppen climate classification, Barcelona has a hot summer Mediterranean climate (Csa), with mild winters and warm to hot summers, while the rainiest seasons are autumn and spring. The rainfall pattern is characterised by a short (3 months) dry season in summer, as well as less winter rainfall than in a typical Mediterranean climate. However, both June and August are wetter than February, which is unusual for the Mediterranean climate. This subtype, labelled as “Portuguese” by the French geographer George Viers after the climate classification of Emmanuel de Martonne and found in the NW Mediterranean area (e.g. Marseille), can be seen as transitional to the humid subtropical climate (Cfa) found in inland areas.
Barcelona is densely populated, thus heavily influenced by the urban heat island effect. Areas outside of the urbanised districts can have as much as 2 °C (36 °F) of difference in temperatures throughout the year. Its average annual temperature is 21.2 °C (70.2 °F) during the day and 15.1 °C (59.2 °F) at night. The average annual temperature of the sea is about 20 °C (68 °F). In the coldest month, January, the temperature typically ranges from 12 to 18 °C (54 to 64 °F) during the day, 6 to 12 °C (43 to 54 °F) at night and the average sea temperature is 13 °C (55 °F). In the warmest month, August, the typical temperature ranges from 27 to 31 °C (81 to 88 °F) during the day, about 23 °C (73 °F) at night and the average sea temperature is 26 °C (79 °F). Generally, the summer or “holiday” season lasts about six months, from May to October. Two months – April and November – are transitional; sometimes the temperature exceeds 20 °C (68 °F), with an average temperature of 18–19 °C (64–66 °F) during the day and 11–13 °C (52–55 °F) at night. December, January and February are the coldest months, with average temperatures around 15 °C (59 °F) during the day and 9 °C (48 °F) at night. Large fluctuations in temperature are rare, particularly in the summer months. Because of the proximity to the warm sea plus the urban heat island, frosts are very rare in the city of Barcelona. Snow is also very infrequent in the city of Barcelona, but light snowfalls can occur yearly in the nearby Collserola mountains, such as in the Fabra Observatory located in a nearby mountain.
Barcelona averages 78 rainy days per year (≥ 1 mm), and annual average relative humidity is 72%, ranging from 69% in July to 75% in October. Rainfall totals are highest in late summer and autumn (September–November) and lowest in early and mid-summer (June–August), with a secondary winter minimum (February–March). Sunshine duration is 2,524 hours per year, from 138 (average 4.5 hours of sunshine a day) in December to 310 (average 10 hours of sunshine a day) in July.