Nanocarbon materials recognized as effective and inexpensive catalysts for independent electrochemical reactions, are anticipated to possess a broader spectrum of multifunctionality toward oxygen reduction reaction (ORR), oxygen evolution reaction (OER), and hydrogen evolution reaction (HER). A rational design of trifunctional nanocarbon catalyst requires balancing the heteroatoms-doping and defect-engineering to afford desired active centers and satisfied electric conductivity, which however is conceptually challenging while desires in-depth research both experimentally and theoretically. This work reports a N,B-codoped graphitic carbon nanocage (NB-CN) with graphitic yet defect-rich characteristic as a promising trifunctional electrocatalyst through a facile thermal pyrolysis assisted in-situ catalytic graphitization (TPCG) process. Density functional theory (DFT) calculations are conducted, for the first time, to demonstrate that the best performance for ORR/OER and HER can be originated from the configuration with B meta to a pyridinic-N, which presents a minimum theoretical overpotential of 0.34V for ORR, 0.39V for OER, and a lowest Gibbs free-energy (ΔGads) of 0.013eV for HER. A primary zinc-air battery is assembled presenting a maximum power density of 320mWcm−2 along with excellent operation durability, evidencing great potential in practical applications.