Nitrogen-containing chars were prepared by low-temperature carbonization (460 degrees C) of compounds containing pyrrolic, pyridinic, amino and cyano groups. The changes of precursor functionalities and transformation of nitrogen structures at 600 and 800 degrees C were determined by X-ray photoelectron spectroscopy. From all precursors, at low-temperature carbonization, three types of nitrogen structure were obtained: pyrrolic, pyridinic and quaternary, but from a precursor containing cyano groups this group was also observed. The concentration of pyrrolic and pyridinic structures decreases with increasing calcination temperature, whereas the amount of quaternary nitrogen increases. Quaternary nitrogen is the most stable form of the observed nitrogen structures, but an additional peak appeared at 403 eV for chars calcined at 800 degrees C.