The increasing land degradation is a problem that affects many soils in countries with a Mediterranean climate. In this aspect the soil organic matter (SOM) plays an important role, due to its progressive biodegradation parallels to desertification and the concomitant emissions of CO2 to the atmosphere. These facts make basic research on the structure and composition of SOM important for soil conservation. Organic N-compounds in soil are of particular interest due to their chemical structure and speciation status in the SOM which can play an important role in soil N bioavailability and in the whole biogeochemical activity of the soil. For this reason, studying the possible relationships between the different N-compounds and soil properties, such as SOM content and its chemical characteristics, can provide new information on the stabilization and storage of organic C in soil. For this research, 30 soils from Spanish ecosystems with a wide range of SOM content were selected. The molecular composition of SOM in whole soil samples including N-compounds, was analyzed by analytical pyrolysis (Py-GC/MS). A parallel characterization of SOM quality was carried out using solid state 13C NMR and UV–vis spectroscopy. Based on their chemical structure, the N-compounds identified by Py-GC/MS were classified into seven main groups: indoles, pyridines, pyrazoles, benzonitriles, imidazoles, pyrroles and quinolines. Multivariate statistical analyses were used to explore the relationship between the distribution of the above compounds and the SOM content. A significant predictive model was obtained for the SOM using partial least squares (PLS) regression, which was used to predict SOM content using the pyrolytic N-compounds as descriptors. This would show that there is a relationship between the patterns of N-compounds and the biogeochemical mechanisms involved in the different C storage levels the soils. Also, multidimensional scaling (MDS) and principal components analysis (PCA) showed to what extent the individual N-compounds are informative of status and quality of the humic acid fraction of SOM. As a whole, the results obtained by Py-GC/MS suggest that indoles, alkylindoles, alkylbenzimidazoles and alkylpyridines could be indicators of SOM accumulation while unsubstituted benzonitrile and pyridine are related to SOM quality.