Soil nutrients are essential for plant survival, especially in karst regions where soil erosion is a significant threat, leading to ecosystem degradation. Rocks exposed in these areas contribute to fragmented soil coverage and the complex spatial distribution of soil nutrients, hindering vegetation recovery. In this study, we collected 60 soil samples (0–30 cm deep) from a typical rocky desertification slope. Classical statistics and geostatistics were used to assess the spatial variability of the following key soil properties: soil organic carbon (SOC), total nitrogen (TN), total phosphorus (TP), and total potassium (TK). The study mapped a continuous surface of soil nutrients using the ordinary kriging method to analyze the spatial variability of the karst slope. The results showed that, except for the bulk density and porosity, which showed little variation, the other soil characteristics had moderate to high levels of variability. The SOC, TN, and TP levels decreased with soil depth, while the TK content increased with soil depth. Each soil layer has strong spatial autocorrelation in its SOC. The variability of TP and TK decreases with soil depth, indicating strong spatial autocorrelation. In the 0–10 cm soil layer, the SOC displays the highest level of continuity, with the TN exhibiting a higher level of variability compared to the other nutrients. Within the 10–20 cm soil layer, the SOC, TN, TP, and TK all exhibit strong spatial autocorrelation. Moving to the 20–30 cm soil layer, the structural variability of SOC is the most pronounced. The correlation between soil nutrients and other soil properties was not strong, with only a cumulative explanatory power of 11.81% in the first two axes of a redundancy analysis (RDA). Among them, the bulk density and silt content had a significant impact on soil nutrients. Studying the spatial variability of soil nutrients in rocky desertification areas is crucial for improving soil quality and promoting vegetation restoration.