Developing biochar with large specific surface area (SSA), heteroatom doping, and porous structure is attracting substantial attention to absorb electromagnetic wave (EMW) in recent. Herein, a novel method of ethanol and KOH co-treatment is used to produce the biomass carbon deriving from pitaya peels. The obtained carbon possesses the high SSA of 1580 m2/g, successful N/O atoms co-doping, and massive pores with different size. The results of EMW absorption measurement show that the prepared biochar could achieve over 99 % absorpition to EMW, which the highest reflection loss is of ca. -45.25 dB at 7.54 GHz with an effective absorption bandwidth (EAB) of ca. 4.87 GHz. The execellent microwave absorption property is caused by the surface defects, dipole and interface polarizations of the synthesized biochar owning unique microstructure and N/O atoms co-doping. Hence, this avenue provides a new reference for fabricating low-cost and eco-friendly biochar as a microwave absorber.