Monodisperse bulk boron- and nitrogen-doped functional resin and carbon nano/microspheres are of particular importance in several applications, despite the lack of highly efficient syntheses to date. Herein, a simple protocol to synthesize monodisperse bulk boron- and nitrogen-doped polymer nano/microspheres is reported using a surfactant-free hydrothermal polymerization of 3-hydroxyphenylboronic acid and formaldehyde with the participation of ammonia for the first time. The size of polymer spheres can be highly tuned from 92 to 1741 nm by varying the concentration of ammonia or precursors (3-hydroxyphenylboronic acid and formaldehyde) and the ratio of alcohol/water. Monodisperse bulk boron- and nitrogen-doped carbon spheres were first fabricated by pyrolysis of the corresponding polymer spheres in high yields due to their excellent thermal stability. The composition and structure of the polymer and carbon spheres were characterized in detail using NMR, FT-IR, XPS, Raman spectroscopy, and/or EDX, which further demonstrated their formation mechanism. Bulk boron- and nitrogen-doped carbon sphere electrodes exhibited good performance as a supercapacitor. The facile method may extend the syntheses of polymer and carbon nanomaterials with desirable properties to various additional applications. © The Royal Society of Chemistry.