Rational design and economic fabrication are essential to develop carbonic electrode materials with optimized porosity for high-performance supercapacitors. Herein, nitrogen-doped hollow carbon nanospheres (NHCSs) derived from resorcinol and formaldehyde resin are successfully prepared via a self-template strategy. The porosity and heteroatoms in the carbon shell can be adjusted by purposefully introducing various dosages of ammonium ferric citrate (AFC). Under the optimum AFC dosage (30 mg), the as-prepared NHCS-30 possesses hierarchical architecture, high specific surface area up to 1987 m2·g−1, an ultrahigh mesopore proportion of 98%, and moderate contents of heteroatoms, and these features endow it with a high specific capacitance of 206.5 F·g−1 at 0.2 A·g−1, with a good rate capability of 125 F·g−1 at 20 A·g−1 as well as outstanding electrochemical stability after 5000 cycles in a 6 M KOH electrolyte. Furthermore, the assembled NHCS-30 based symmetric supercapacitor delivers an energy density of 14.1 W·h·kg−1 at a power density of 200 W·kg−1 in a 6 M KOH electrolyte. This work provides not only an appealing model to study the effect of structural and component change on capacitance, but also general guidance to expand functionality electrode materials by the self-template method.