The whale shark (Rhincodon typus, Smith 1828) is among the largest fish that tends to swim at the surface in aggregation. Several locations in are known habitats for whale sharks. However, there is still a need to understand the environmental factors that influence their occurrences and sighting. This paper investigated the environmental factors essential to whale sharks' s in Kilindoni bay, Mafia. Data were collected through observations supplemented with secondary historical data sets from 2012 to 2019, including whale shark sightings and environmental variables. These datasets were obtained from the Marine Megafauna Foundation (MMF) and the Tanzania Fisheries Research Institute (TAFIRI). The Generalized Linear Model (GLM) was used to analyse 510 whale shark sighting records from October to February (2012–2019). The variables involved were sea surface temperature, zooplankton abundance, moon illumination, and weather conditions. Results revealed that weather conditions (χ2 = 10.626, df = 4, p = 0.031), zooplankton abundance (χ2 = 206.580, df = 2, p = 0.001), and moon illumination (χ2 = 7.464, df = 1, p = 0.006) are significant factors influencing the sighting of whale sharks. Sea Surface Temperature (χ2 = 0.951, df = 1, p = 0.329) was not a significant factor in the sighting of whale sharks. Generally, weather conditions, moon illumination, and zooplankton abundance were vital factors for the Mafia's distribution of whale sharks. The study recommends sustained, regular monitoring of environmental variables linked to whale sharks, reinforcing the implementation of a code of conduct for whale shark sighting, and advocating for an integrated management approach inclusive of all local stakeholders.