Visit Madrid any time except winter
Madrid is good for tourism all year round. In my opinion, best times to visit are May to late June or September to late October, as there are still tons of outside terraces (Madrid’s trademarks) and the temperature is lovely.
Also avoid July-August (way too hot, plus all locals go on vacation and half the bars and stores are closed), and late November and December (short days, too cold to be outside and too rainy).
If possible, avoid the hot, crowded and expensive, peak summer months of July and August. Best time is shoulder season May and September. For festivals come to Madrid in the spring.
Madrid Peak Season
Peak season in Madrid is during June, July, and August. The summer is by far the most popular time to visit the Spanish capital. During this time, lines at attractions will be long and accommodation at its most expensive.
Best Weather to visit Madrid
The ideal time to visit Madrid weather wise is between May and the beginning of July. The rain is just about finished and the weather is getting warmer. Madrid starts to get very warm by July and August so it’s best to visit before then.
Best Time for Sightseeing
The off-season in Madrid is during the winter months and after the summer winds down. January to March and October to November typically see lower numbers of tourists in the country. During this time you will enjoy deals on hotels and few lines at the famous attractions.
Shopping Season in Madrid
There are two major sales periods in Madrid and throughout Spain, called “rebajas”. The first sale of the year begins the 7th of January and can last anywhere from a few days to a few weeks. The second begins on the 7th of July. Great deals from a variety of shops can be found during the rebajas.
Cheapest time to visit Madrid
The best time to visit Madrid is during the off-season. As mentioned above, from January to March, as well as October and November, the amount of tourism decreases in Spain which means prices must drop to cater to the few tourists left. During these times you will be able to save on accommodation, food, and transportation.
Festive season in Madrid
If you can visit Madrid during Madrid carnival don't miss it. It is lot of fun, I have seen tourists enjoying it. There are parades, grand balls and fancy dress competition where locals dress up and roam about at night. Madrid Carnival is celebrated in the month of February, though the exact dates vary by the year.
Don’t expect festivals in Madrid
Curiously, Madrid doesn’t have any fixed traditional festivals.
There are tons of different music festivals and food festivals throughout the year in different neighborhoods, but dates are never fixed so you should have to check the agenda once you decide when you are coming.
Local fiestas in August
Each neighborhood has a “fiesta week” with food and music on the streets, usually in the summer (mostly August). Each week it moves to a different area, so you can enjoy them all.