One of the major determinants of crop productivity and sustainable agricultural practices is soil fertility. Proper soil assessment helps farmers make informed decisions about nutrients and fertilizers. This study utilizes 16 machine learning classifiers for soil fertility prediction, including learner-based, ensemble-based, instance-based, and probabilistic-based models. The model’s performance is assessed using accuracy, precision, recall, and F1-score. This paper presents a machine learning model for predicting soil fertility based on soil physicochemical characteristics. The data used in the research comprise vital soil parameters: nitrogen, phosphorus, potassium, pH, organic carbon, electrical conductivity, and micronutrients. Missing-value imputation, label encoding, and feature standardization are among the data preprocessing methods used to enhance data quality. Correlation analysis, ANOVA F-score, and mutual information were used to assess feature importance and determine the most significant soil characteristics. The experimental observation reveals that the RF model achieves an accuracy of 90.91% compared to the other models. Additional assessment using multi-class Receiver Operating Characteristic (ROC) and Precision–Recall (PR) curves showed excellent discriminative ability across the dominant soil fertility, which was of high quality. The findings show that machine learning models, especially ensemble-based models, are effective at estimating soil fertility levels. The proposed framework provides a data-driven, reliable decision-support system to assess soil fertility, enabling farmers and agricultural experts to enhance nutrient management and crop production.