The remediation effects of peanut shell biochar (HBC) and Mg-modified peanut shell biochar (MHBC) prepared under pyrolysis temperatures of 300 °C and 600 °C on Cd2+ polluted brown soil were investigated in a pot experiment. The results showed that the biochar treatment increased soil pH and decreased the bioavailable Cd2+ content in the soil. Compared with the control treatment (CK), the pH value increased by 0.32 to 2.5 upon treatment with 1% and 2% of HBC and MHBC. Bioavailable Cd2+ in the soil decreased by 5.64% to 21.33% with HBC. The MHBC presented better amendment effects than HBC; bioavailable Cd2+ in the soil decreased by 26.2% to 50.1% with the addition of MHBC. The addition of HBC and MHBC increased the shoot height and decreased the root length of the spinach. Moreover, they significantly decreased the accumulation of Cd2+ in the shoots and roots of the spinach. Compared to CK, the Cd2+ content in the shoots decreased by 7.0% to 46.8% upon treatment with 1% and 2% of HBC and MHBC, while the Cd2+ content in the roots decreased by 7.3% to 52.7%. The Cd2+ content in the shoots and roots was more greatly decreased with MHBC than with HBC.