Separated boron and nitrogen porous graphitic carbon (BNGC) is fabricated by a facile hydrothermal coordination/ZnCl2-activation process from renewable and inexpensive nitrogen-containing chitosan. In this synthetic pathway, chitosan, which has a high nitrogen content, first coordinates with Fe3+ ions to form chitosan–Fe that subsequently reacts with boric acid (boron source) to generate the BNGC precursor. After simultaneous carbonization and ZnCl2 activation followed by removal of the Fe catalyst, BNGC, containing isolated boron and nitrogen centers and having a high surface area of 1567 m2 g−1 and good conductivity, can be obtained. Results indicate that use of chitosan as a nitrogen-containing carbon source effectively prevents nitrogen atoms from direct combination with boron atoms. In addition, the incorporation of Fe3+ ions not only endows BNGC with high graphitization, but also favors for nitrogen fixation. Remarkably, the unique microstructure of BNGC enables its use as an advanced electrode material for energy storage. As electrode material for supercapacitors, BNGC shows a high capacitance of 313 F g−1 at 1 A g−1, and also long-term durability and coulombic efficiency of >99.5 % after 5000 cycles. Notably, in organic electrolytes, the energy density could be up to 50.1 Wh kg−1 at a power density of 10.5 kW kg−1. The strategy developed herein opens a new avenue to prepare BNGC without inactive BN bonds from commercially available chitosan for high-performance supercapacitors.