Carbon-based supercapacitors have high power density and long cycle life; however, they are known to suffer from problems related to low energy density and high inner resistance. Here, we report a novel hierarchically porous functional carbon that is made up of interconnected exfoliated carbon nanosheets with thickness of a few nanometers. Notably, these porous carbon nanosheets are doped with abundant nitrogen (N) dopants in the basal plane and phosphorus (P) functional groups at the edge of the graphene lattice. The specific surface chemistry and pore structure of the synthesized sample, combined with its large specific surface area, make it a high-performance active material for supercapacitor electrode. The obtained supercapacitor made with the optimized sample showed a high specific capacitance (265 F g–1 at 0.5 A g–1) as well as long-term stability (94% capacitance retention after 5000 cycles). Particularly, the enhanced electrochemical characteristics were maintained even at high electrode mass loading (time constant (τ0) is 1.10 s for an electrode mass loading of 12.38 mg cm–2 compared to 1.61 s for a mass loading of 4.17 mg cm–2 for commercial activated carbon), which is important for a high packing factor of the capacitor.