Heteroatom doping is an efficient way to tailor the electrochemical properties of carbon-based energy storage materials. However, synthesizing nitrogen-doped carbon materials with a high doping level (e.g. over 10.0 at.% N content) and controllable doping contents is very challenging. Herein, a tablet-sintering method using two nitrogen sources (ammonia and urea) is proposed to realize the regulation of nitrogen contents in the carbon materials from 4.8 at.% to almost 12.0 at.%. Optimized sample with 10.1 at.% nitrogen content demonstrates excellent pseudocapacitive behaviors with 104.1 F g-1 and 176.3 F g-1 for the lithium- and sodium- ion capacitorsin organic electrolytes at 1 A g-1. Moreover, highly doped nitrogen could promote the cycling stability of carbon-based materials high voltage (up to 5.0 V) in the ionic liquid electrolyte. This may open a new avenue for the chemical doping of carbon-based materials and their applications in high-performance electrochemical devices.