In this paper, we report a facile and novel synthesis of nitrogen-containing ultramicroporous carbon nanospheres (N-UCNs) for high performance supercapacitor electrodes. Phloroglucinol and terephthalaldehyde are polymerized to obtain polymer nanoparticles with a mean diameter of ∼15nm. Hexamethylenetetramine (HMTA) is utilized to substitute ammonia and formaldehyde to polymerize with resorcinol on the surfaces of the polymer colloids for the fabrication of carbon spheres under the Stöber condition. The introduction of phloroglucinol/terephthalaldehyde brings regular ultramicroporous (0.58nm) to the typical N-UCNs. Besides, the polymerization of resorcinol and HMTA on the surfaces of polymer nanoparticles reduces the diameter of carbon nanospheres from submicrometer sizes to nanoscaled sizes (∼36nm). Furthermore, the NH4 + released from the hydrolysis of HMTA also acts a source of nitrogen in the carbon framework (1.21at.%), which can improve the surface properties and electric conductivity of N-UCNs. The typical N-UCNs (N-UCN4.50) with spherical geometry, high surface area (1439m2 g−1), regular ultramicropores and nitrogen functional groups shows excellent electrochemical performance such as high specific capacitance (269Fg−1 at 1.0Ag−1), long-term cycle stability (90.3% retention after 10000 charge/discharge cycles) in 6M KOH aqueous electrolyte. This finding provides new opportunities for well-designed carbon nanospheres to achieve advanced supercapacitor electrodes.