Soil organic carbon (SOC) stands out as a crucial indicator for assessing soil properties due to its direct impact on soil productivity. To delve into this, we collected 350 soil samples from depths ranging from 0 to 30 cm in the northwest region of Iran, measuring SOC levels. Concurrently, we obtained vegetation indices from Landsat 8 and Sentinel-2 satellite images. Subsequently, we employed machine learning techniques, specifically artificial neural network (ANN) and random forest (RF) models, to estimate the spatial distribution of SOC. In the subsequent phase, we classified the land units of the region based on physiography, vegetation, erosion, flooding, soil type, and depth for a more accurate comparison of estimation models. We then compared the average values of measured and predicted SOC within these land units. The evaluation of ANN and RF models, utilizing vegetation indices from Landsat 8 and Sentinel-2 satellites, revealed that the RF method, particularly when using vegetation indices from the Sentinel-2 satellite, exhibited superior accuracy in predicting SOC (R2 = 0.8, RMSE = 0.19, and ρc = 0.81). Moreover, when comparing the estimated and predicted average values of SOC in different land units, we observed no significant difference between the measured and predicted averages using the RF method. This underscores the robustness of the RF model in accurately predicting SOC by leveraging vegetation indices extracted from Sentinel-2 satellite data. Consequently, the RF model emerges as a reliable tool for SOC evaluation, offering precise forecasts and contributing to cost and time savings by minimizing the need for extensive soil sampling and laboratory analysis.