Carbonaceous materials have long been a key component of supercapacitor energy storage systems, and exploring nitrogen atom doping and its role is currently the focus of carbon-based electrode development. However, achieving a high proportion of pyridinic N (active N) in N-doped carbon is still a big challenge. Here, by introducing a triblock copolymer F127 into the phenolic resin, the pore structure of the two-dimensional carbon material is successfully adjusted, thereby increasing the probability of generation of active nitrogen. We found that this two-dimensional porous structure is beneficial to the formation of pyridinic N. Through the change of pore structure, the ratio of pyridinic N to the total N was further increased by 13.9 %.Therefore, it provides a large specific capacitance (220 F g À 1 ), excellent cycle stability (93.6 %) and high rate performance (71.2 %) in the alkaline KOH electrolyte. To further increase the energy density, we constructed an symmetrical supercapacitor device using an ionic liquid electrolyte (equal amount of 1ethyl-3-methylimidazolium tetrafluoroborate and acetonitrile). As a result, since the electrolyte has a voltage window of up to 3 V, the energy density is as high as 37.5 Wh kg À 1 . This superior performance indicates that adjusting the ratio of pyridinic N provides a promising method for preparing excellent N-doped carbon materials for energy storage systems.