Soil carbon sequestration, including organic (SOC) and inorganic carbon (SIC), between shelterbelt and croplands may exhibit divergent responses to edaphic factors as the consequences of soil acidification caused by agricultural fertilization for the latter. In this regard, the aim of this study was to determine the variations and determinants of SOC and SIC content in the top 100 cm for shelterbelt forest (SF) and crop fields (CF) in drylands. In total, 480 soil samples (30×4×4) were collected from 30 paired SF and CF within different distance (CF_0.25H, CF_0.5H, CF_1H) at four depths (0–10, 10–30, 30–50, and 50–100 cm) in the middle reaches of the Heihe River Basin, NW China. The results showed that there were no significant ( P > 0.05) differences in the content of soil total carbon (STC), SOC, SIC, and the ratio of SIC to SOC between SF and CF. Meanwhile, there was a significant ( P < 0.01) linear relationship between SOC and STC at varied depths, and SOC and the ratio of SOC to STC were deceased as soil depths increase, suggesting SIC play a dominant role in the subsoil. Variance partitioning analysis showed edaphic factors can explained 78.19 % and 70.10% variation of SOC, and 45.10% and 49.70% variation of SIC for SF and CF, respectively. Pearson’s correction analysis, random forest, linear mixed effects model and structural equation model consistently indicated that soil nutrient play a significant role in determining SOC, while physicochemical properties contribute to SIC. In conclusion, our study demonstrates the contrasting response of SOC and SIC to edaphic factors, but the consistency of abiotic factors in determining soil carbon for shelterbelt and croplands. Our findings provide an improved understanding between soil carbon sequestration and abiotic factors for agroforestry in drylands.