Analysis-ready data, complete analysis code, cross-validation fold assignments, out-of-fold predictions and georeferenced 10 m prediction, uncertainty, dissimilarity and applicability rasters supporting the article 'High-resolution mapping of soil macronutrients in a semi-arid climate (Morocco) using Sentinel-2 data and machine learning models', submitted to Environmental Monitoring and Assessment. 110 composite topsoil samples (0-20 cm) and 40 Sentinel-2 predictors; performance assessed by nested spatial block cross-validation over 10 spatial blocks. The eleven 10 m GeoTIFFs are included in this Zenodo record but not in the GitHub repository.