Despite successful commercialization of graphite in lithium ion batteries (LIBs), it is still necessary to develop cost-efficient carbon materials with high capacity and rate capability. Here we report a nitrogen-rich (17.72 at%), hierarchically porous carbon (NHPC) produced by low-cost and large-scale synthetic method through spray granulation followed by pyrolysis under flowing NH3. The synthetic approach featuring using low-cost raw materials (glycine as carbon/nitrogen source and NaCl as template) and industrial spray granulation shows promising application in commercial practice. Benefitting from the rich nitrogen doping and homogeneously porous structure, the NHPC delivers a reversible capacity as high as 1276.5 mA h g−1 at current density of 100 mA g−1 when used as anode for LIB. After 200 cycles at current density of 500 mA g−1, a reversible capacity of 930.6 mA h g−1 remains without any capacity fading compared to the second cycle, showing good electrochemical performance. Even at higher current density of 2 A g−1, a reversible capacity of 582.6 mA h g−1 is achieved, highlighting the superior rate capability compared with most reported carbon-based materials. The mechanism of lithium storage in NHPC is studied in depth by kinetic analysis to figure out the reason for the achieved much higher capacities and rate capability than the theoretical capacity (372 mA h g−1, by forming LiC6) and most reported ones. It is found that there exists considerable capacitive charge storage owing to the adsorbed lithium on the surface of carbon in NHPC, which resulted in the superior rate capability and cycling stability. Besides the adsorbed lithium (capacitive charge storage) and inserted lithium (by forming LiC6 or LiC6@Li4C3N4), deposited lithium in micropores is also found to contribute to achieving the high lithium storage of NHPC.