With the shady and sunny northern slopes of Qilian Mountains along an altitude gradient from 2600 m to 3600 m as test objectives, this paper studied the vertical distribution patterns of surface soil (0-20 cm) organic carbon (SOC) and total nitrogen (TN), and their relations to the altitude, landform, and vegetation. The results indicated that SOC and TN contents were significantly higher on shady than on sunny slope, and all increased with increasing altitude. The SOC and TN contents under different vegetation types were in the order of alpine bush > Picea crassifolia forest > alpine meadow > Sabina przewalskii forest, and alpine bush > alpine meadow > P. crassifolia forest > S. przewalskii forest, respectively. SOC had significant positive correlations with altitude, annual precipitation, soil moisture, and soil TN, and significant negative correlations with soil pH and annual temperature. Soil C/N ratio along the gradient was within the range of 6.7-23.3, being favorable to the nutrient release during organic matter decomposition. Among the factors affecting SOC, the annual temperature, precipitation, and soil moisture content constituted the first principal component, and soil C/N ratio constituted the second principal component. These two principal components accounted for 71% of the variance of SOC content, suggesting that climate factors controlled the vertical distribution patterns of SOC and TN along the altitude gradient.