Highly ordered N-doped mesoporous carbon/graphene frameworks (N-MCF/N-MGF) were prepared using superlattice of self-assembled Fe3O4 nanoparticles as template. The prepared N-MCF catalyst shows enhanced oxygen reduction reaction (ORR) activity compared with commercial Pt/C catalyst. The N-MGF catalyst demonstrates lower oxygen evolution reaction (OER) overpotential (324mV at 10mAcm−2) than most of the previously reported carbon based materials, non-noble metal oxides and their hybrids, and comparable with noble metal oxides (ruthenium/iridium oxide, RuO2 and IrO2) catalysts. The prepared N-MGF catalysts also exhibit negligible mass transfer resistance, good durability and bifunctionality in ORR and OER. The significantly improved electrocatalytic performance results from their large surface area, ordered pores, excellent internal diffusion property, and superior intrinsic conductivity. The materials show great potential for various applications in energy conversion and storage, including fuel cells, electrolyzers and metal-air batteries.