Sodium-ion batteries (SIBs) and potassium-ion batteries (PIBs) are potential alternatives of lithium-ion batteries (LIBs) due to their high energy density and low cost. Unfortunately, they are difficult to use for large-scale grid energy storage due to the lack of suitable anode materials for sodium/potassium energy storage. Biomass-derived carbon, which is widely available and environmentally friendly, is one of the most promising anode materials for SIBs/PIBs, but the design and regulation of its microstructure is exceptionally complex. By selecting suitable biomass precursors, it is expected that biomass-derived carbon with suitable microstructures can be simply prepared. In this study, wedelia chinensis were selected as biomass precursors, and biomass-derived carbon materials with large interfacial spacing, suitable pores and high specific surface area were prepared by a simple one-step pyrolysis method. The material exhibited fast energy storage kinetics when electrochemically tested as an anode and showed different performance advantages in storing sodium/potassium. When tested as an anode for SIBs, it exhibited excellent specific capacity and cycling stability (380.7 mA h g− 1 after 500 cycles at 100 mA g− 1); When tested as an anode for PIB, it exhibited excellent rate performance (128.6 mA h g− 1 at 10 A g− 1).