The present research was focused on determination of the pH value online by visible and near infrared spectroscopy. In the part of data gathering, fresh pork longissimus dorsi was moving at the constant velocity of 0. 25 m . s(-1) on the conveyor belt, and the visible and near-infrared diffuse reflectance spectrum (350-1 000 nm) was captured. In the part of data processing, band of 510-980 nm of the spectra was chosen to calibrate reflex distance, then to set up online detection model of pH value in fresh pork by partial least squares regression (PLSR). Kennard-stone algorithm was applied to divide the samples to the calibration set and validation set. The performances of several PLSR models employing various preprocessing methods including multiple scatter correction, derivative and both of them combined were compared. Further, the best performance model was optimized by interval PLSR to decrease the modeling variables of wavelength. The results indicated that the PLSR model based on preprocessing of multiple scatter correction (MSC) combined with first derivative gave the best performance with 0. 905 of the correlation coefficient for validation set and 0. 051 of the root of mean square errors for validation set. For the best PLSR model performance, the correlation coefficient of validation set increased to 0. 926 and the root of mean square errors for validation set to 0. 045 in the optimization interval PLSR model. However, only half of variables were used. The research demonstrates that using visible and near-infrared spectroscopy to determine fresh pork pH online is feasible.