To determine the heavy metal(loid)s (HMs) contamination of agricultural soil in hotbed chives hometown of Tangchang, 788 topsoil samples were collected and analyzed for their heavy metal(loid)s concentration. The index of geo-accumulation (I geo), pollution index (PI) and potential ecological risk index (EI i ) were used to assess the degree of pollution. Correlation analysis and principal component analysis (PCA) were used to determine the sources of soil HMs. Human health risks estimated with hazard index (HI) and carcinogenic risk (CR) indices based on ingestion, inhalation and dermal exposure pathways for adults and children. The mean values of Cd, Hg, As, Pb, Cr, Cu, Ni and Zn were 0.221, 0.155, 9.76, 32.2, 91.9, 35.2, 37.1 and 108.8 mg kg −1, respectively, which did not exceed the threshold values of the risk screening value for soil contamination. The potential ecological risk of soil heavy metal(loid)s was low level and there was no significant human health risk. Based on PCA, Pb and Hg may originate from transportation and atmospheric deposition, Zn, Cr and Ni may originate from natural sources and industrial activities, and Cu and Cd may originate from agricultural activities. Overall, from the perspective of HMs content, the soil quality in this study area was at a clean level. This study provides a reference and a basis for formulating effective measures to prevent and control HMs enrichment in agricultural soils.