Core Ideas Spectra could predict soil texture on wet samples with similar soil moisture. PDI can be used to improve the prediction accuracy when soil moisture is unknown. The study provides a method for determination of soil texture in the field. The accuracy and precision of predictions of soil texture based on visible–near-infrared (Vis-NIR) spectra are affected by the soil moisture content at the time of measurement. This study aimed to quantify these effects. We also developed a method to improve the accuracy of soil texture prediction when the difference in moisture content is large and unknown, as is usually the case in field measurements. Reflection spectra (380–2400 nm) of 89 soil samples were obtained in the laboratory under nine moisture conditions. Prediction models for each moisture condition were built separately using partial least-squares (PLS) regression. Each model was applied to independent validation sets under the same moisture condition as the calibration sets, and then the model based on air-dried soils (dry model) was applied to the other eight moisture conditions to quantify the effect of soil moisture on the prediction accuracy. Finally, the perpendicular drought index (PDI) was used as an indicator of soil moisture, and the nine moisture conditions were regrouped to four groups using the PDI. Prediction models for each group with the same PDI were built and evaluated. The results show that Vis-NIR spectra can be directly applied to predict the soil texture of soils in different known moisture states. When the moisture state is unknown, the models based on PDI grouping markedly improve prediction accuracy. The RMSEp of prediction from PDI-grouped models of prediction of the content of clay and sand separates were between 1 and 2% and between 8 and11%, respectively, for the different moisture classes. This method has potential for direct application in the field with on-the-go sensors.