On the island there is very little Malaria, only in the dirty sub-urbs from Stonetown area.
Incase you go to the mainland, into the tropical forest, don’t hesitate to take your pills. Otherwise, don’t worry too much. We have been here on the coast for a long time now (over 15 years) and we did not use any pills, because on the coast the malaria mosquitoes are not common.
If however you are in doubt, always check with your practitioner at home before you go to Zanzibar. But note that they always will see Tanzania as one part and tell you to take the pills, which mostly make you more sick at your travels.