The development of low-cost electrocatalysts with high oxygen evolution reaction (OER) and oxygen reduction reaction (ORR) performance is crucial for devices used to convert and store hydrogen energy. Research on OER and ORR catalysts has attracted a lot of attention. The limited single-functional catalysts can be expanded as bi-functional catalysts to meet the extra requirement of preparing high-performance catalysts. In this study, we prepared Co-ZIF/CNF in which carbon nanofibers uniformly encapsulated Co– nanoparticles by electrospinning and simple pyrolysis. Co-ZIF/CNF contains both CoOx and Co-Ny active sites, showing bifunctional activity for OER and ORR. The optimized catalyst Co-ZIF1.5/10CNF2 has a low OER overpotential of 390 mV, an onset potential of 0.93 V and a half-wave potential of 0.85 V of ORR, exhibiting an outstanding OER and ORR catalytic performance. The catalyst retained 87.53 % of its current after 12 h, showing great stability. This paper provides a new strategy for designing and preparing OER and ORR bifunctional catalysts.