Heteroatom doped hollow nanocarbons have attracted tremendous research interests owing to their distinct structural features. Nevertheless, the low specific surface area, less developed microporosity, thick carbon walls, and low heteroatom contents severely limits its further application. Herein, a facile, tunable template route has been developed for the synthesis of N-doped hollow carbon nanoboxes (N-HCNbs) by employing polyvinylpyrrolidone, micron-sized magnesium oxide, and potassium bicarbonate as carbon precursor, template, and activator, respectively. Through optimizing the template content, N-HCNbs with large specific surface area (1660.2 m 2 • g À 1 ), well-developed micropores (83.6 %), and high heteroatom contents can be obtained. Significantly, the ultrathin carbon walls (8-10 nm) can further accelerate the diffusion kinetics which endow N-HCNbs a good cathode for Zn-ion hybrid supercapacitors (ZHSCs). The resulting ZHSCs device can deliver a high specific capacity of 136.2 mAh • g À 1 at 0.2 A • g À 1 , excellent rate performance (49 % of capacity retention at 50 A • g À 1 ) and ultralong cycling life over 24000 cycles. This work offers an efficient protocol for heteroatom doped hollow nanocarbons for electrochemical energy storage application.