Nonprecious bifunctional oxygen reduction reaction (ORR)/oxygen evolution reaction (OER) catalysts in wide pH electrolytes are crucial for the versatile use of electrochemical energy storage and conversion devices. Non-noble metal/nitrogendoped carbon (M−N/C) has been reported as a promising candidate for efficient and cost-effective bifunctional catalysts. Nevertheless, the stability and catalytic activity of M−N/C bifunctional catalysts in a wide pH range are still limited, especially in neutral and acidic electrolytes. Here, we synthesized directly grown N-doped bamboo-like carbon nanofiber-encapsulated cobalt nanoparticles on carbon flakes (Co−N/C fiber) via pyrolysis of 2D cobalt−zeolitic imidazolate framework and tubular g-C 3 N 4 . The in situ growth of N-doped carbon nanofiber incorporated with Co nanoparticles exposes large active sites and enhances charge transfer. Moreover, abundant mesopores with high loading of pyridinic-N, graphitic-N, Co@N/C, and Co−N x facilitate high catalytic activity in a wide pH condition. Co−N/C fiber shows superior ORR performance in alkaline, neutral, and acidic electrolytes with high onset potentials of 1.003, 0.820, and 0.800 V vs RHE, respectively. A comparable OER performance of Co−N/C fiber to the Ir/C benchmark in alkaline and neutral conditions can be obtained with 397 and 570 mV overpotentials at 10 mA cm −2 . Utilizing Co−N/ C fiber in alkaline and neutral Zn−air batteries exhibits power densities of 155 and 67 mW cm −2 , with excellent stability for over 180 h. This study offers a strategy for developing a bifunctional M−N/C catalyst that is applicable across a wide pH range via hybrid nanostructuring.