In agricultural soil analysis, the challenge of soil salinization in regions like Krishna District, Andhra Pradesh, profoundly impacts soil health, crop yield, and land usability, affecting approximately 77,598 hectares of land. To address this issue, three machine learning algorithms are compared for classifying salinity levels in the coastal area of Krishna district, Machilipatnam. This study utilizes Landsat-8 images from 2014 to 2021, correcting for cloud cover and creating a true-color composite. The study area is defined and visualized. Twelve indices, derived from Landsat imagery, are incorporated into the analysis. These indices, including spectral bands and mathematical expressions, are added as image bands. The median of these indices is calculated, and sample points representing both non-saline and saline areas are used for supervised machine learning. The data is divided into two sets: training and validation. The study evaluates Random Forest, Classification and Regression Trees, and Support Vector Machines for classifying soil salinity levels using these indices. The RF algorithm produced an accuracy of 92.1%, CART produced 91.3%, and SVM produced 86%. Results are displayed on the map, representing predicted salinity levels with distinct colors. Performance metrics are evaluated, and they assess algorithm performance. The research involved gives insights into the classification of soil salinity using machine learning, which could represent an efficient solution to the problem of soil salinization in Machilipatnam.