3D phosphorus (P)-doped graphene (3D-PG) was synthesized by a facile method. 3D-PG was evaluated as an efficient metal-free electrocatalyst for H2O2 sensing. 3D-PG sensor exhibited exceptional sensing performances for H2O2 detection. The good performances are due to the synergy of 3D porous structure and P-doping. 3D-PG could be used for real-time tracking H2O2 released from living HeLa cells.