The determination of carbon is one of the most important in soil analysis. However traditional techniques are costly and time consuming. In this manuscript we propose an alternative predictive approach based on portable mid-infrared spectroscopy data modeled by machine learning techniques. We evaluate the performance of different machine learning models and sample size to predict soil carbon in 457 Australian soils. The results show a good performance of the models. All models are validate by statistical tests. The best performing technique with a 99% of confidence level is the Gaussian Process providing a 98% of accuracy for the prediction of soil carbon. Moreover, this technique is the most robust for the different sample sizes tested. When compared with the commonly used Partial Least Squares Regression technique, the machine learning approaches provide more successful and balanced results.