Optimisation of the annealing time for the fabrication of nitrogen-doped graphitic-spheres (NDGSs), formed from a nitrogen-functionalised aromatic precursor at 800 °C, to give high nitrogen doping has been performed. Thorough analysis of the NDGSs, approximately 3 μm in diameter, pinpointed an optimum annealing time of 6 to 12 hours to obtain highest nitrogen content at the surface of the spheres (reaching a stoichiometry of around C3N at the surface and C9N in the bulk), with the quantity of sp2and sp3surface nitrogen varying with annealing time. The results suggest that changes in the nitrogen dopant level occur through slow diffusion of the nitrogen throughout the NDGSs, along with reabsorption of nitrogen-based gases produced during annealing. A stable bulk nitrogen dopant level of 9% was revealed in the spheres. The NDGSs performed well as anodes in lithium-ion batteries, providing a capacity of up to 265 mA h g−1at a charging rate of C/20, but did not perform well in sodium-ion batteries without the use of diglyme, consistent with the presence of graphitic regions, but with low internal porosity.