An important and inhibiting issue about fuel cells is related to the slow kinetics of oxygen reduction reaction (ORR) in the cathode electrode. In this research using density functional theory (DFT) calculations, the phosphorus-doped graphitic C3N4 nanosheet (PC@C3N4) is used as a metal-free electrocatalyst for the ORR. Phosphorus doping on the surface of graphitic C3N4 increases the probability of O2 adsorption on the substrate and subsequently improves its electrocatalytic activity. Also, reaction pathways and optimal reaction mechanisms are determined. Our results show that PC@C3N4 exhibits outstanding catalytic activity towards oxygen reduction through a four-electron pathway. The free energy diagram shows that all the steps for the dissociation and hydrogenation of oxygen molecules are exothermic at potentials of <0.26 V. The results presented in this paper can provide a better insight into the process of the ORR mechanism on the heteroatom-doped nanosheets and pave the way for the fabrication of low-cost materials with high electrocatalytic activity in fuel cell cathodes.