To study the effects of biogas residue application on nutrient and heavy metal content in soil and yield of crops under peanut-wheat rotation, field experiments were carried out including six fertilizer treatments, i.e., 1.5×104 kg/hm2 (A1), 3.0×104 kg/hm2 (A2), 4.5×104 kg/hm2 (A3), 6.0×104 kg/hm2 (A4), 7.5×104 kg/hm2 (A5) and no biogas residue treatment (CK, A6), with the application of 750 kg/hm2 compound fertilizer as basal fertilizer in each treatment. The grain yield of crops, the heavy metal content in grains, and the soil nutrient and heavy metal content were determined respectively. The results showed that the yield of peanut using biogas residue increased by 4.74% to 9.03% compared with that of the control, the yield of A2, A3, A4 and A5 was significantly higher than that of control (A6) (P<0.05); the yield of wheat using biogas residue increased by 3.08%-7.38% compared with that of the control, the yield of A2, A3, A4 and A5 was significantly higher than that of control (A6) (P<0.05); treatment A2 had significantly higher yield of peanut and wheat compared with that of A6, and the lowest biogas residue using amount, so it was the appropriate application amount of biogas residue. Compared with no biogas residue application, the addition of biogas residue significantly increased soil nutrients’ content, the content variation range of soil organic matter, total nitrogen, available phosphorus, available potassium was 56.80-107.23 g/kg, 0.26%-0.45%, 93.77-128.67 and 218.33-329.67 mg/kg, respectively. Hg and As were not detected in peanut or wheat grains, and the content of Pb, Cd and Cr changed in the range of 0.023-0.07, 0.11-0.23 and 0.015-0.062 mg/kg, respectively, all lower than The National Food Safety Standard Maximum Levels of Contaminants in Foods (GB 2762—2017). The soil content of Hg, Pb, Cd, Cr and As was 0.046-0.061, 23.4-29.7, 0.09-0.22, 71.1-89.5 and 12.0-14.4 mg/kg, respectively, all were lower than The Soil Environmental Quality - Agricultural Land Soil Pollution Risk Control Standard (Trial) (GB 15618—2018).