1. Periphyton in aquatic ecosystems play a crucial ecological role in element cycling and are susceptible to natural disturbances and anthropogenic activities.To understand the responses of periphytic communities to water quality factors and altitude gradients, DNA metabarcoding was employed to investigate the distribution characteristics of epilithic periphyton (comprising prokaryotes and eukaryotes).2. Epilithic periphyton and water were sampled at 26 sampling sites with an altitude ranging from 445 to 1,565 m in the Jue River and its three tributaries in Qinling Mountain, China. The altitudinal patterns of water quality variables were initially investigated, followed by redundancy analysis and distance-based linear models to explore the responses of community structure to altitudes and water quality. Meanwhile, the relationship between these variables and fluorescence parameters to reflect the photosynthesis of epilithic periphyton along an altitudinal gradient was examined.3. The results indicated that with decreasing elevation, water quality variables including total dissolved solids (TDS), water temperature, conductivity, salinity, and concentrations of NO − 3 -N, total nitrogen, and NO − 2 -N increased. This pattern was closely associated with the intensification of anthropogenic disturbance downstream. Specifically, higher salinity and water temperature downstream may reduce the prokaryotic biodiversity but promote the diversity and evenness of eukaryotes; higher concentrations of total nitrogen may increase the diversity, richness, and evenness of the whole periphyton community. Furthermore, salinity, nutrients, and TDS were identified as crucial variables shaping periphyton community structure, especially salinity and TDS, which were linked to the growth of chlorophytes.4. The attenuated maximum photochemical efficiency of periphyton at high altitudes indicated that photosystem II was inhibited, while the enhancement of maximum photochemical efficiency at low altitudes may be attributed to the