As an important part of the soil microbial system, fungi can clearly indicate changes in the soil environment.Human activities in the city can easily affect the soil condition, so the phenomenon of artificial heavy metal enrichment often appears in urban soil. The objective of this study was to analyze the fungal community structure in different urban functional areas and to determine the effect of heavy metal content in different urban functional areas on the soil fungal community structure. This study provides theoretical basis for protecting and repairing the urban soil ecosystem and transforming and improving urban environmental quality. Soil samples from eight sampling sites in five functional areas of Beibei District in Chongqing were taken as the research objects. The diversity and community structure of fungi in soil were studied using high-throughput sequencing technology. The content of Cd and Hg in the soil of different functional areas in Beibei District exceeded the environmental background value of Chongqing. The 20-40 cm and 40-60 cm soil layers of JD were slightly polluted. The 20-40 cm soil layer and 0-20 cm soil layer of JLD and ZYY, respectively, were in the alerting state of heavy metal pollution. The Sobs index, Chao 1 index, and Ace index of most sampling points decreased with the increase in soil depth. The NMDS analysis showed that the composition of fungal communities between the 0-20 cm and 20-40 cm soil depths in both JD and ZYY were quite different. From the perspective of community composition, Ascomycota was the most abundant phylum in the soil, followed by unclassified _k _Fungi and Basidiomycota. At the genus level