The reactions of surface functional groups have an important role in controlling conversion of char nitrogen to NOx during coal combustion. This study involved an investigation of the thermal stability and reactions of nitrogen surface functional groups in nanoporous carbons. Four suites of carbons, which were used as models for coal chars, were prepared with a wide range of nitrogen and oxygen contents and types of functional groups. The porous structures of the carbons were characterized by gas adsorption methods while chemical analysis, X-ray photoelectron spectroscopy, and X-ray near edge structure spectroscopy were used to characterize the surface functional groups. Temperature programmed desorption and temperature programmed reduction methods were used to study the reactivity of the surface functional groups during heat treatment under inert and reducing conditions. Heat treatment studies show that the order of stability of the functional groups is quaternary nitrogen > pyridinic > pyrrolic > pyridine N-oxide. Pyridine N-oxide surface groups desorb NO and form N-2 via surface reactions at low temperature. Pyrrolic and pyridinic functional groups decompose and react with surface species to give NH3, HCN, and N-2 as desorption products, but most pyrrolic groups are preferentially converted to pyridinic and quaternary nitrogen. The main desorption product is N-2. Approximately 15-40 wt % of the original nitrogen was retained in the carbons mainly as quaternary nitrogen after heat treatment to 1673 K. The results are discussed in terms of decomposition ranges for surface functional groups and reaction mechanisms of surface species.