Map from Google - Miami

The climate of Miami is tropical, with pleasantly warm winters, and long and hot summers.
Here are the average temperatures.
Average temperatures - Miami
MiamiJanFebMarAprMayJunJulAugSepOctNovDec
MiamiJFMAMJJASOND
Min (°F)575961667073757575726459
Max (°F)757781828688909088848177

Rainfall amounts to about 60 inches per year. There is no real dry season, although the least rainy season is winter, from December to February. In summer, from May to October, the rains are abundant, but they occur in the form of showers and thunderstorms, which release a lot of rain in a short time, and therefore do not reduce too much the sunshine hours.
Here is the average precipitation.
Average precipitation - Miami
MiamiJanFebMarAprMayJunJulAugSepOctNovDecYear
MiamiJFMAMJJASONDY
Prec. (in)222.43.96.37.56.77.19.48.32.81.860
Days55568111413151276107

Winter in Miami is pleasantly warm. Rainfall is fairly rare, and is linked to the cold fronts that sometimes can move from the continent to southern Florida. The waves of frost typical of large areas of the United States do not arrive here: in fact we are almost at the Tropic. Every so often, however, from December to March, a bit of cold air can come here, bringing mainly a little cold at night for two or three days, with lows around 41/46 °F, while the days remain very mild, around 64/68 °F. In the exceptional January 1977, when many Americans states were hit by an intense cold wave, in Miami the temperature went down for a couple of nights to 31 °F, but even in those days of low-temperature records, highs remained about 59 °F. In January the 22nd, 1985 it happened again, with a minimum temperature of 30 °F and a maximum temperature of 59 °F.

The short spring, in March and April, is warm, and there is already an almost summery weather, but without the sticky heat that will reign in the following months.

The long summer, from May to October, is hot, but above all sultry, although sea breezes give a bit of relief. Showers and thunderstorms are frequent and sometimes may be intense, but for the rest the sun shines regularly.

From June to November Miami may be affected by hurricanes, which in any case are more frequent from mid-August to late September. Some of the past hurricanes have hit directly south Florida and have been destructive, such as Okeechobee in September 1928, the Great Miami Hurricane in September 1926, and Andrew in August 1992.

The amount of sunshine in Miami is very good all year round. The sunniest months are March and April, while the least sunny are those of winter, when the sun still often shines. In summer the sky is not always clear: scattered clouds can form quite often, and can sometimes swell up, leading to showers and thunderstorms, then the sun will shine again.

South Beach

For swimming, the sea is warm enough all year round, as it does not drop below 75 °F in winter, while in summer it gets very warm, so that it's possible to take long baths.
Here are the average sea temperatures.
Sea temperature - Miami
MiamiJanFebMarAprMayJunJulAugSepOctNovDec
MiamiJFMAMJJASOND
Sea (°F)757575778184848684827977

When to go

The best time to visit the city of Miami and explore the nature around it, like the Keys or the Everglades, goes from December to April. In winter Miami is definitely the warmest and most sheltered place in the United States, and there are many sunny days, but sometimes there can be a bit of wind, cool air and some rain.
For swimming, as we saw the sea is warm enough even in winter, although the weather is not always ideal: sometimes it can be cool, and even a little cold: so it's better to go in the period going from mid-March to late April. In May, the heat begins to be felt and thunderstorms increase in frequency, but you can still go. Of course you could also go in the long summer, but there is a muggy heat, as well as the risk, which should not be underestimated though statistically unlikely, of hurricanes.

See also the climate of Florida.