In light of the possibility of addressing energy and ecological issues simultaneously, diversity in electrocatalysis and the storage of energy are important objectives in material design. In the last few decades, carbon compounds with heteroatom doping (N, P, and S) have shown immense potential for harnessing energy. Owing to the complicated postdoping processes, the traditional method for the inclusion of hetero atoms like nitrogen within the framework of carbon becomes extremely difficult. Herein, we report a self-sacrificial (self-doping) viologen-based covalent triazine polymer template for the production of nitrogendoped carbon, thus obviating the need for the time-consuming and tedious postdoping steps. The annealed counterpart with spherical morphology, because of its higher homogeneously distributed nitrogen content (13%) and higher specific surface area, exhibits outstanding capability for oxygen reduction reaction (ORR). The obtained onset potential of 0.94 V vs reversible hydrogen electrode (RHE), diffusion limiting current density of 5.85 mA/cm 2 , E 1/2 of 0.8 V vs RHE, and approximately four-electron ORR route are comparable to the benchmark ORR catalyst (20% Pt/C). In addition, the ACTP-2 has exceptional long-term durability with only a 12 mV dip in the E 1/2 after 2000 cycles, which is very intriguing. It also displays better tolerance toward methanol, outperforming the corresponding Pt/C counterpart. Remarkably, the ACTP-2-based zinc−air battery shows excellent durability with a specific capacity value nearing the theoretical value (754 mAh/g Zn ). Furthermore, upon galvanostatic charging and discharging with ACTP-2+RuO 2 , outstanding reversibility is obtained with a lesser voltage gap of 0.71 V and good cyclic stability which overcomes the Pt/C+RuO 2 performance. Thus, our effort paves the way for the synthesis of heteroatom-doped carbon whose nitrogen-active sites trigger the oxygen electrocatalytic activity, which is key for the zinc−air battery.