Hydrogen peroxide produced by electrochemical oxygen reduction reaction provides a potentially cost effective and energy efficient alternative to the industrial anthraquinone process. In this study, we demonstrate that by modulating the oxygen functional groups near the atomically dispersed cobalt sites with proper electrochemical/chemical treatments, a highly active and selective oxygen reduction process for hydrogen peroxide production can be obtained in acidic electrolyte, showing a negligible amount of onset overpotential and nearly 100% selectivity within a wide range of applied potentials. Combined spectroscopic results reveal that the exceptionally enhanced performance of hydrogen peroxide generation originates from the presence of epoxy groups near the Co–N4 centers, which has resulted in the modification of the electronic structure of the cobalt atoms. Computational modeling demonstrates these electronically modified cobalt atoms will enhance the hydrogen peroxide productivity during oxygen reduction reaction in acid, providing insights into the design of electroactive materials for effective peroxide production.