Abstract Biomass‐derived carbon is a promising electrode material in energy storage devices. However, how to improve its low capacity and stability, and slow diffusion kinetics during lithium storage remains a challenge. In this research, we propose a “self‐assembly‐template” method to prepare B, N codoped porous carbon (BN‐C) with a nanosandwich structure and abundant pyridinic N‐B species. The nanosandwich structure can increase powder density and cycle stability by constructing a stable solid electrolyte interphase film, shortening the Li + diffusion pathway, and accommodating volume expansion during repeated charging/discharging. The abundant pyridinic N‐B species can simultaneously promote the adsorption/desorption of Li + /PF 6 − and reduce the diffusion barrier. The BN‐C electrode showed a high lithium‐ion storage capacity of above 1140 mAh g −1 at 0.05 A g −1 and superior stability (96.5% retained after 2000 cycles). Moreover, owing to the synergistic effect of the nanosandwich structure and pyridinic N‐B species, the assembled symmetrical BN‐C//BN‐C full cell shows a high energy density of 234.7 W h kg −1 , high power density of 39.38 kW kg −1 , and excellent cycling stability, superior to most of the other cells reported in the literature. As the density functional theory simulation demonstrated, pyridinic N‐B shows enhanced adsorption activity for Li + and PF 6 − , which promotes an increase in the capacity of the anode and cathode, respectively. Meanwhile, the relatively lower diffusion barrier of pyridinic N‐B promotes Li + migration, resulting in good rate performance. Therefore, this study provides a new approach for the synergistic modulation of a nanostructure and an active site simultaneously to fabricate the carbon electrode material in energy storage devices.