Soil heavy metal contamination poses a significant threat to both environmental health and ecological safety. To investigate the influencing factors, ecological hazards, and sources analysis of heavy metals in purple soil, 27 sets of soil samples were collected from varying genetic horizons within Guang’an City, and the contents of As, Cd, Cu, Cr, Hg, Ni, Pb, and Zn were analyzed. The results indicated higher concentrations of heavy metals in soil A horizon, compared to that of C horizon. The relevance analysis indicated that the soil’s heavy metals were strongly correlated with the soil’s physicochemical properties. The enrichment factor, pollution load index, and potential risk index highlighted slightly to severely polluted levels of soil Cd and Hg, which significantly contribute to the ecological hazards posed by soil heavy metals. The potential source of heavy metals analyzed using the APCS-MLR model identified both anthropogenic inputs and natural sources as primary contributors to heavy metal presence in soils. The Cu, Cr, Ni, Pb, and Zn contents in the samples from different genetic horizons were chiefly influenced by natural sources, such as soil matrix erosion and weathering, while the concentrations of Cd and Hg were largely affected by anthropogenic activities, specifically coal combustion and agriculture. Conversely, the As content was found to be influenced by a combination of both factors. Anthropogenic activities greatly impacted soil heavy metals at various depths within the study area, thereby underscoring the importance of monitoring these heavy metals. The findings gained from this research can give a scientific basis for the potential utilization of purple soil.