Nitrogen-doped (1.2–4.5 wt%) carbon xerogels were synthesized from carbonization of resorcinol-formaldehyde polymer in an ammonia atmosphere at various temperatures. The textural properties and the chemical nature of nitrogen in the nitrogen-doped carbon