Metal-free nitrogen-doped carbon is considered as a green functional material, but the structural determination of the atomic positions of nitrogen remains challenging. We recently demonstrated that directly-excited solid state 15N NMR (ssNMR) spectroscopy is a powerful tool for the determination of such positions in an N-doped carbon at natural 15N isotope abundance. Here we present a green chemistry approach to the synthesis of N-doped carbon using cellulose as precursor, and a study of the catalytic properties and atomic structures of the related catalyst. The N-doped carbon (NH3) was obtained by oxidation of cellulose with HNO3 followed by ammonolysis at 800°C. It had a N content of 6.5 wt.% and a surface area of 557 m2 g–1, and 15N ssNMR spectroscopy provided evidence for graphitic nitrogen besides of regular pyrrolic and pyridinic nitrogen. This structure determination enabled probing the role of graphitic nitrogen for electrocatalytic reactions, such as the hydrogen evolution reaction (HER), oxygen evolution reaction (OER), and nitrite reduction reaction. The N-doped carbon catalyst (NH3) had higher electrocatalytic activities in OER and HER under alkaline conditions and a higher activity for nitrite reduction, as compared with a catalyst prepared by carbonization of the HNO3-treated cellulose in N2. The electrocatalytic selectivity for nitrite reduction of the N-doped carbon catalyst (NH3) was directly related to the graphitic nitrogen functions. Complementary structural analysis by means of 13C and 1H ssNMR, scanning electron microscopy (SEM), transmission electron microscopy (TEM), X-ray diffraction (XRD), X-ray photoelectron spectroscopy (XPS), Raman spectroscopy, and low-temperature N2 adsorption were preformed and provided support to the findings. The results show that directly-excited 15N ssNMR at natural 15N abundance is generally capable to provide information on N-doped carbon materials, and it is expected that the approach can be applied to a wide range of solids with an intermediate amount of N atoms.