Electrocatalysts are essential to two key electrochemical reactions, oxygen evolution reaction (OER) and oxygen reduction reaction (ORR) in renewable energy conversion and storage technologies such as regenerative fuel cells and rechargeable metal–air batteries. Here, we explored N-doped graphene as cost-effective electrocatalysts for these key reactions by employing density functional theory (DFT). The results show that the substitution of carbon at graphene edge by nitrogen results in the best performance in terms of overpotentials. For armchair nanoribbons, the lowest OER and ORR overpotentials were estimated to be 0.405V and 0.445V, respectively, which are comparable to those for Pt-containing catalysts. OER and ORR with the minimum overpotentials can occur near the edge on the same structure but different sites. These calculations suggest that engineering the edge structures of the graphene can increase the efficiency of the N-doped graphene as efficient OER/ORR electrocatalysts for metal–air batteries, water splitting, and regenerative fuel cells.