Porous bio‑carbon from agroindustry waste behaves one of the most promising anode materials for sodium-ion batteries (SIBs) because of its high sodium storage capacity, low cost, sustainability, and low charge/discharge voltage platform. Herein, we have developed a new N/P/O co-doped porous hard carbon derived from peanut shell (PSCNP) synthesized via KOH activation, hydrothermal doping combined with carbonization method, using chitosan as nitrogen source, phytic acid as phosphorus source, and peanut shell as carbon and oxygen source. Through seriously regulating the calcination temperature, the optimal PSCNP-800 carbonization at 800 °C can well combine the advantages of the natural rich porous microstructure of peanut shells, large graphite interlayer spacing (0.379 nm), and short diffusion distance for sodium-ion. As an advanced anode for SIBs, the PSCNP-800 delivered a reversible capacity of 248.8 mAh g−1 after 100 cycles at 25 mA g−1. This work could provide a possible idea for the preparation of N/P/O co-doped porous hard carbon from low-cost agroindustry waste as anodes for SIBs.