May and October, when the weather is generally warm and dry, are considered the best months for touring Madrid. May gives you more hours of daylight for sightseeing, while October offers a chance to enjoy the harvest season.
Because Spain is the number-one destination for European tourists, the months of June, July, August, and September tend to be crowded and more expensive. August is the month when Spaniards themselves take vacations; the annual migration to the beach causes huge traffic jams on August 1 and 31. But Madrid is delightfully relaxed and empty during August; small shops and some restaurants shut down for the entire month, but museums remain open.
The following are average daily maximum and minimum temperatures for Madrid: December-February 36-52°F (2-11°C); March-April 41-64°F (5-18°C); May 50-70°F (10-21°C); June and September 57-81°F (14-27°C); July-August 63-88°F (17-31°C); October-November 41-66°F (5-19°C).
Today weather: