To uncover the reaction mechanism of nitrogencontaining heterocyclic compounds affecting coal self-heating, quantum chemical calculations and X-ray photoelectron spectroscopy (XPS) experiments were applied to elucidate the reaction pathways and thermodynamic characteristics of pyrrole, pyridine, indole, quinoline, and carbazole. Results show that in pyrrole, pyridine, indole, quinoline, and carbazole, the reaction with O-2 captures the H atom and leads to the formation of center dot OOH and pyrrolyl, pyridinyl, indolyl, quinolinyl, and carbazolyl radicals, respectively. The activation energies are 118.15, 86.642, 34.132, 21.004, and 47.259 kJ/mol, respectively. ROO center dot formed by spontaneous adsorption of O-2 by nitrogen-containing radicals undergoes self-reaction, and the O-O bond is broken and dehydrogenated to generate center dot OH. Subsequently, at room temperature, center dot OH reacts with pyrrole, pyridine, indole, quinoline, and carbazole, resulting in the formation of H2O and pyrrolyl, pyridinyl, indolyl, quinolinyl, and carbazolyl radicals, respectively, thereby forming a cyclic chain reaction. The XPS analysis yielded the following findings: (i) when the temperature rises to 70 degrees C, the N-5 and N-6 content decrease, which is attributed to the activation energy; (ii) when the temperature reaches 200 degrees C, the N-5 content decreases, which can be attributed to the activation energy required for the oxidation of pyrrole (118.5 kJ/mol).