Periphyton is a complex community composed of diverse prokaryotes and eukaryotes; understanding the characteristics of microbial communities within periphyton becomes crucial for biogeochemical cycles and energy dynamics of aquatic ecosystems. To further elucidate the community characteristics of periphyton across varied aquatic habitats, including unpolluted ecologically restored lakes, aquaculture ponds, and areas adjacent to domestic and industrial wastewater treatment plant outfalls, we explored the composition and diversity of prokaryotic and eukaryotic communities in periphyton by employing Illumina MiSeq sequencing. Our findings indicated that the prokaryotic communities were predominantly composed of Proteobacteria (40.92%), Bacteroidota (21.01%), and Cyanobacteria (10.12%), whereas the eukaryotic communities were primarily characterized by the dominance of Bacillariophyta (24.09%), Chlorophyta (20.83%), and Annelida (15.31%). Notably, Flavobacterium emerged as a widely distributed genus among the prokaryotic community. Unclassified_Tobrilidae exhibited higher abundance in unpolluted ecologically restored lakes. Chaetogaster and Nais were enriched in aquaculture ponds and domestic wastewater treatment plant outfall area, respectively, while Surirella and Gomphonema dominated industrial sewage treatment plant outfall area. The alpha diversity of eukaryotes was higher in unpolluted ecologically restored lakes. pH and nitrogen content ( , , and TN) significantly explained the variations for prokaryotic and eukaryotic community structures, respectively. Eukaryotic communities exhibited a more pronounced response to habitat variations compared to prokaryotic communities. Moreover, the association networks revealed an intensive positive correlation between dominant Bacillariophyta and Bacteroidota. This study provided useful data for identifying keystone species and understanding their ecological functions.