Balancing cost and performance of porous carbon (PC) as anode for lithium-ion battery (LIBs) is the key to effectively promote commercial application. Herein, low-cost N-doped PC (NPC-Ts, T = 600, 750 and 900 °C) were facilely prepared in batches via one-pot pyrolysis of agar with different carbonization temperature. The NPC-750 with specific surface area of 2914 m2/g and N content of 2.84% exhibits an ultrahigh reversible capacity of 1019 mAh/g at 0.1 A/g after 100 cycles and 837 mAh/g at 1 A/g after 500 cycles. Remarkably, the resulting LIBs exhibit an ultrafast charge-discharge feature with a remarkable capacity of 281 mAh/g at 10 A/g and a superlong cycle life with a capacity retention of 87% after 5000 cycles at 10 A/g. Coupling with LiFePO4 cathode, the fabricated lithium-ion full cells possess high capacity, excellent rate and cycling performances (125 mAh/g at 100 mA/g, capacity retention of 95%, after 220 cycles), highlighting the practicability of this NPC-750 as the anode materials.