Fine control of nitrogen-doping in carbon materials is an urgent issue with great challenges for the applications in energy storage devices. In this work, nitrogen-doped hollow carbon spheres (NHCS) with tunable nitrogen-doping properties are synthesized by using graphitic carbon nitride (g-C3N4) nanosheets as precursor and Zinc powder as the template. A series of characterization techniques were performed to evidence the successful transformation of NHCS from g-C3N4. The nitrogen-doping level from 12.76 at.% to 27.82 at.% and the relative doping fractions of pyridinic-N, pyrrolic-N and graphitic-N for the g–C3N4–derived carbon materials can be easily tuned by controlling the synthetic temperatures. Serving as Li-ions battery anodes, the resultant NHCS delivers an acceptable initial discharge capacity of 1012.4 mAh g−1 under a current density of 0.1 A g−1 and a promising cycling stability (1064.5 mAh g−1 after 400 cycles) as well as an excellent rate performance (360 mAh g−1 at 10 A g−1). This work provides a facile gateway to synthesize high nitrogen-doped carbon materials applying to energy storage devices, from nitrogen-rich g-C3N4 precursor.