Electrochemical generation of hydrogen peroxide (H2O2) via two-electron oxygen reduction is a promising alternative to the conventional industrial anthraquinone process. The current challenges include discovering a sample and cost-effective electrocatalysts with high activity, selectivity, and stability. Herein, we reported a straightforward preparation of cobalt-N-doped ordered mesoporous carbon (Co-N-OMC) using dry-state low energy ball milling, followed by controlled pyrolysis. This fast, solvent-free, and scalable method used inexpensive materials containing cobalt acetate as the metal precursor, mesoporous SiO2 (KIT6) with a high surface area as the template for controlling the mesoporous structure; and imidazole as carbon and nitrogen sources, allowing simultaneous carbon matrix formation and nitrogen incorporation. Moreover, the Co-N-OMC electrocatalytic performance was compared with various materials, including N-OMC, Co-OMC, OMC, and non-mesoporous carbon, to separately examine each component's role, embedded Co, N dopant, and mesoporous morphology on the catalyst behavior. The optimal Co-N-OMC catalyst displayed an excellent electrocatalytic activity with H2O2 selectivity above 95% in an acid medium at very positive potentials. Furthermore, batch H2O2 electrolysis measurements confirmed the high H2O2 faradaic selectivity over 90% and H2O2 production of 555 mmol g-1 for a 60 min test. Finally, laboratory-scale H2O2 production was demonstrated in a flow electrolytic reactor with a Co−N−OMC cathode layer. The H2O2 electrolysis in flow cell configuration exhibitedabout a five-time-increase in H2O2 production ~ 2900 mmol g-1 for 60 min test with H2O2 faradaic selectivity above 90%. Such a considerable improvement in H2O2 production and selectivity is probably due to cobalt particles' coexistence with nitrogen dopants supported on a mesoporous structure. The optimal loading of cobalt might facilitate the two-electron pathway towards H2O2 generation.In addition, nitrogen dopants and the mesoporous structure may have lowered the ORR overpotential and improved mass transport in the catalyst layer, respectively.