To provide scientific basis for the prevention and control of heavy metal pollution, a field investigation, sample collection and analysis of the heavy metal content in farmland soils at the northern foot of the Qinling Mountains were conducted. Based on the comparative analysis of the single pollution index method, the Nemerow comprehensive pollution index method, the geological accumulation index method, the potential ecological hazard index method, and the geological accumulation index method were used to comprehensively analyze and evaluate the risk of soil heavy metal pollution. The results showed that the heavy metal pollution of farmland soil at the northern foot of the Qinling Mountains was severe, among which Hg and Cr pollution was relatively obvious. Taking the soil screening values of agricultural land as the standard, the quantity of element Hg in agricultural soils at the northern foot of the Qinling Mountains was higher than the relevant screening value. In the two sample sites investigated, the intensity of the heavy metal accumulation index in Baoqizhai Village was Hg > Cr > Cu > As > Pb, and in Dayangyu Village it was Cr > Cu > As > Pb. Among them, in Baoqizhai Village it shows the heavy pollution caused by Hg (Igeo= 3.42) and the light pollution caused by Cr (Igeo < 1) in the two areas. Hg is mostly affected by mining activities and its atmospheric subsidence. At the same time, Cr is mainly derived from the weathering of rock parent material and is also affected by anthropogenic factors to a certain extent. The accumulation of heavy metals in the farmland soil around the northern foot of the Qinling Mountains was relatively high, posing a threat to the surrounding soil environment. Therefore, it is urgent to control farmland soil environmental pollution.