The species richness and community composition of the diatom communities were studied in the Baltic Sea, Northern Europe, to enhance knowledge about the diversity of these organisms in a brackish water ecosystem. Many organisms in the Baltic Sea have been studied extensively, but studies investigating littoral diatoms are scarce. The goal of this study was to examine the importance of climatic, spatial and water physicochemical variables as drivers of epilithic diatoms in the Gulf of Finland and the Gulf of Bothnia. The variation in species richness was best explained by pH, total phosphorus and total nitrogen. Redundancy Analysis indicated that the most important factors correlating with species composition were air temperature, silicon, total phosphorus, water temperature, salinity and pH. Variation Partitioning showed that the species composition was mostly affected by climatic and spatial variables, whereas physicochemical variables had little impact. However, the strongest factor was the combined influence of climatic, spatial and physicochemical variables. The results suggest that diatom species richness in the northern Baltic Sea is primarily regulated by local factors, while climatic and spatial variables have little impact on richness. Species composition is mostly affected by climatic and spatial variables. We conclude that understanding the distribution patterns of Baltic Sea diatoms requires the inclusion of climatic, spatial and water chemistry variables.