Electrochemical hydrogen peroxide (H2O2) synthesis via the two-electron oxygen reduction reaction (2e- ORR) is considered a promising alternative to the anthraquinone process due to its eco-friendliness and on-site production. Recently, although B-doped carbon (BC) has been suggested as a promising 2e- ORR catalyst, the question of whether BC can further improve catalytic activity by tuning the doping configuration and site still remains unanswered. This work demonstrates CO2-derived edge-B-doped porous carbon (E-BPC) for highly effective electrochemical H2O2 production. Herein, it is revealed that the oxygenated B-doping configurations (BCO2 and BC2O) at edge sites are responsible for enhanced 2e- ORR activity and stability. Outstanding mass activity (54.7 A g−1 at 0.65 V vs. RHE) is demonstrated with the highest high production rate in a flow reactor among the reported studies, of 24.3 mol gcat−1 h−1. The faradaic efficiency of the E-BPC was maintained (∼82%) for over 100 h without performance degradation.