Phytoplankton forms the foundation of the aquatic food chain, with their community composition dependent on environmental conditions. Research on phytoplankton communities in relation to environmental variables across diverse coastal ecosystems in Bangladesh remains limited and focusing on small or discrete areas. This study aimed to explore phytoplankton dynamics across contrasting ecosystems characterized by varying salinity levels (ranging from 0 to 36 ppt), encompassing riverine to marine ecosystem. We identified 48 species, encompassing 28 genera and 4 groups: diatoms (81.25%), blue-green algae (10.41%), dinoflagellates (4.18%), and green algae (4.16%), with Coscinodiscus concinnus (W. Smith) being the most dominant species. Seasonality significantly affected phytoplankton diversity and richness, with the highest diversity (H = 3.55) and richness (40 species) recorded in winter. Conversely, contrasting ecosystems had an effect on richness, but not on diversity with the highest 42 species in the estuarine ecosystems. ANOVA showed notable spatio-temporal heterogeneity in species abundance (p <
0.05), with a peak in the estuarine ecosystem during winter. Variability in environmental factors was also significant, with the exception of pH with seasons, while alkalinity and transparency showed insignificant differences among contrasting ecosystems. We identified distinct seasonal community successions, with a unique species composition in the winter, while the monsoon and pre-monsoon communities exhibited some degree of convergence. A strong correlation between species abundance and environmental factors was evident, especially salinity, alkalinity, and dissolved oxygen, playing major role in species distribution and seasonality. This study provides insights into phytoplankton dynamics and their response to environmental factors, providing baseline ecological information for ecosystem management in the region.