In the present study, the content of dichlorvos in chlorpyrifos was rapidly determined by mid-infrared and near-infrared spectroscopy. The quantitative models were established by partial least squares (PLS) method and optimized. The independent validation sets and 7 test samples were used to evaluate the model accuracy. The results showed that mid-infrared and near-infrared spectroscopy can accurately determine the content of dichlorvos in chlorpyrifos. The RMSEC (the root mean square error of calibration) of the mid-infrared model and near-infrared model was 0.013 and 0.020, respectively. R2 (determination coefficient) both were 1.000. For 7 test samples, RMSEP before model recalibration is 0.22 (MIRS) and 0.09 (NIRS). The adaptability of the near-infrared model was much better and model updating was unnecessary. To sum up, MIR and NIR are both rapid and easy-operation method with simple pretreatment.