Decide when you'd like to visit Madrid by checking these seasonal weather details:
Winter, from December to February, is relatively cold.
The rains, brought by Atlantic depressions, are quite frequent, but generally not abundant.
Summer, from June to August, is hot and sunny.
Spring and autumn are mild and variable, with sunny periods, but also the passage of Atlantic disturbances, which bring clouds and rain.
The best periods to visit Madrid are spring and autumn, in particular, you can choose the month of May, and from mid-September to mid-October.