The development of heteroatom-doped porous carbon derived from biomass waste with high-performance electrodes for supercapacitors has been drawn extensive research. Herein, N, P co-doped porous carbon (NPC) was successfully synthesized using Chinese fir sawdust as a carbon source, NaOH as an activator, urea as a nitrogen source, and melamine phosphate as the phosphorus and nitrogen source by pretreatment with low-temperature NaOH/urea system. The low-temperature pretreatment and melamine phosphate greatly promoted the porous structure and uniform distributions of heteroatom about the NPC. The optimized NPC exhibits high specific surface area (1849 m2/g), hierarchical porous structure with high mesoporosity (87.3 %), appropriate heteroatom content (3.32 at% N, 0.36 at% P), and excellent wettability. This unique facilitates improved electrolyte diffusion efficiency and ion transfer rate. In the three-electrode system, the specific capacitance of the NPC electrode is as high as 260 F/g at 0.5 A/g and remains at 235 F/g at 10 A/g, and the charge transfer resistance is very low (0.08 Ω). In addition, the assembled symmetric supercapacitors deliver an energy density of 15.9 Wh/kg at a power density of 246 W/kg, a long cycling life with 90 % capacitance retention after 5000 cycles. The environment-friendly NPC has a broad development prospect for carbon-based high-performance electrodes for supercapacitors.