In order to analyze the spatial variability of soil nutrients and their ecological chemometrics in Tangchang Town, National Agricultural Park, 20 influencing factors were selected: soil pH, Cd, Hg, As, Cu, Pb, Cr, Zn, Ni, Se, elevation, slope, aspect, land use type, distance from industrial land, distance from commercial land, distance from railway, distance from residential area, distance from highway and distance from river. The effects of various influencing factors on the spatial variability of total organic carbon (TOC), total nitrogen (N), total phosphorus (P), total potassium (K) and ecological stoichiometry were analyzed by means of geographic detector. The results showed that average contents of soil TOC, N, P and K in the study area are 10.24 g kg-1, 1.33 g kg-1, 1.14 g kg-1 and 23.60 g kg-1, respectively, and there were significant differences in the spatial distribution of soil nutrients and their eco-stoichiometry in the study area, and TOC, N, P, K, C/N, C/P, C/K, N/P, N/K and P/K has a significant correlation with each other and most correlation coefficients are above 0.5 or below -0.5. Factor detection showed that soil properties, distance from railway and distance from residential area had the most significant explanatory power to the spatial heterogeneity of soil nutrients and eco-stoichiometry. Interaction detection showed that the interaction between soil properties with other factors was the most important factor affecting the spatial differentiation of soil nutrients and their ecological chemometrics, and elevation, distance from railway and distance from residential area were also important factors. Risk detection showed that the differences of soil nutrients and their ecological stoichiometry were most significant in the subregions of soil properties (pH, Cd, Hg, As, Cu, Pb, Cr, Zn, Ni and Se).