Zanzibar sits just south of the equator, so it does not have a hot season and a cold one. It has wet periods and dry periods, driven by the monsoon winds that also built its history. Temperatures vary less across the year than humidity, wind and rainfall do, which is why a month-by-month reading is more useful than the usual 'best time' verdict.
The kaskazi, the north-east monsoon, runs from around December to February or March: hotter, more humid, lighter winds, and typically the calmest and clearest sea of the year. This is peak snorkelling and diving visibility, and it includes the December and January holiday price peak.
The long rains (*masika*) fall from around late March through May. This is the wettest, most humid stretch, with rain that tends to arrive in heavy bursts rather than all-day drizzle. Many small hotels close for part of it, and prices are at their lowest for those who accept the risk.
The kusi, the south-east monsoon, runs from around June to September or October: the driest, breeziest and most comfortable season, with lower humidity and reliable wind for kitesurfing. It is also the high season that overlaps with the Serengeti's dry-season game viewing, which is why most safari-plus-beach trips land here.
The short rains (*vuli*) fall around November, usually as brief afternoon showers rather than washouts, in a month that offers some of the best value on the island.
One caveat worth repeating: these are patterns, not schedules. The rains have shifted noticeably in recent years, and a dry April or a wet July both happen. Plan around the odds, not around a promise.