Heavy metal contamination of farmland soils is a severe concern worldwide.Chromium (Cr), a major environmental carcinogen, is a crucial indicator of farmland soil pollution. Compared with conventional chemical analysis, the hyperspectral analysis is superior in accurately and rapidly surveilling heavy metals in soils. However, various heavy metals, and types or geochemical traits of soils often affect the accuracy of hyperspectral estimation models, which makes guaranteeing the concentration estimation precision for a designated heavy metal in different regions considerably challenging. We here propose an optimal hyperspectral model for determining the Cr concentration of farmland soils first time in the Yanqi Basin of China's northwest arid zone. In total, 171 soil samples were gathered, and their Cr concentrations and relevant spectral reflectance data were determined. The best spectral transformation for measuring the Cr concentration was determined by using 12 transformation types of soil spectral curves, and characteristic wavebands were obtained. Then, by using random forest (RF), support vector machine (SVM), and partial least squares regression (PLSR) models, we constructed hyperspectral estimation models for Cr concentration in farmland soils. The estimated results of these models were compared to identify the best estimation model. Results show that the spectral transformations allow an improvement in the association between the soil Cr concentration and spectra. The accuracy of PLSR was significantly higher than that of SVM and RF. Finally, the second-order differentiation (SD) combined with the PLSR model (R2 = 0.903, RMSE = 40.363, MAE = 30.631) was identified as the optimal model for estimating the Cr concentration of farmland soils in the investigated area. The study findings offer a technical reference for the hyperspectral assessment of the Cr concentration in arid zone farmland soils.