Abstract Metal‐free carbon materials doped with multiple nonmetal heteroatoms (e. g. N, B, S, P) have emerged as a promising class of electrocatalysts toward oxygen reduction reaction (ORR). Herein, B, N‐codoped carbon electrocatalysts are conveniently prepared by use of ZIF‐8 precursor, which involves cage‐encapsulation of PhB(OH) 2 before high‐temperature pyrolysis. By modulating the B‐doping amount and pyrolysis temperature, an optimal B, N‐codoped carbon electrocatalyst toward ORR is achieved, which shows ORR activity ( E onset =0.95 V, and E 1/2 =0.83 V vs RHE) comparable to the Pt/C benchmark, with a good methanol tolerance and long‐term stability.