Nitrogen-doped carbon xerogels (CXNs) were carbonized across a range of temperatures (400 °C–800 °C) using sol-gel derived resorcinol-formaldehyde xerogel to elucidate their structural evolution during carbonization in ammonia. The investigation extensively probed chemical and structural changes in CXNs at varying carbonization temperatures, employing analytical methods such as X-ray photoelectron spectroscopy, infrared spectroscopy, and energy-dispersive X-ray spectroscopy. These findings were thoroughly compared with the local structure derived from total X-ray scattering and Raman spectroscopy. The results showed a transformation in the local ordering and chemical structure of CXNs, characterized by a reduction in oxidation sites, expansion of C sp2 network structures, leading to the growth of aromatic domains, and the incorporation of nitrogen into the carbon backbone structure. Pyrolysis in ammonia notably influenced the textural structure, resulting in a partial loss of mesopores and an increased micropore volume.