Carbon-based nanomaterials provide an attractive perspective to replace precious Pt-based electrocatalysts for oxygen reduction reaction (ORR) to enhance the practical applications of fuel cells. Herein, we demonstrate a one-pot direct transformation from graphitic-phase C3N4 (g-C3N4) to nitrogen-doped graphene. g-C3N4, containing only C and N elements, acts as a self-sacrificing template to construct the framework of nitrogen-doped graphene. The relative contents of graphitic and pyridinic-N can be well-tuned by the controlled annealing process. The resulting nitrogen-doped graphene materials show excellent electrocatalytic activity toward ORR, and much enhanced durability and tolerance to methanol in contrast to the conventional Pt/C electrocatalyst in alkaline medium. It is determined that a higher content of N does not necessarily lead to enhanced electrocatalytic activity; rather, at a relatively low N content and a high ratio of graphitic-N/pyridinic-N, the nitrogen-doped graphene obtained by annealing at 900 °C (NGA900) provides the most promising activity for ORR. This study may provide further useful insights on the nature of ORR catalysis of carbon-based materials.