Chitosan has become an effective candidate as precursor for nitrogen-doped porous carbon with high specific surface area and desirable electrochemical performance. However, the effect of doping concentration and configuration of nitrogen on electrochemical properties is far from understanding. Here, nitrogen-doped porous carbons (NPCs) with enhanced nitrogen concentration and different nitrogen configurations were synthesized via hydrothermal carbonization and ZnCl2 activation process. When the urea/chitosan ratio varied from 0 to 7.5, NPCs with similar porous texture were obtained, which makes it possible to discuss the influence of nitrogen configurations on their electrochemical performances. The specific surface area of NPC7.5 reached 1465.6 m2/g, and the NPCs show hierarchically porous structure composed of micropores and mesopores. With the urea/chitosan ratio increased from 0 to 7.5, the total ratio of pyridonic N and pyridinic N increased (from 67.9 to 79.7%) and the ratio of quaternary N decreased significantly (from 19.8 to 6.0%). Pyridonic N and pyridinic N are more active for the conductivity of porous carbon during electrochemical reaction, which in turn induced the enhancement of electrochemical performances. The specific capacitance of NPC7.5 reached 303.2 F/g at current density of 1 A/g with solution resistance of only 0.49 Ω and charge transfer resistance of only 0.17 Ω.Graphical abstract