The energetics and the electronic properties of nitrogen- and boron-doped graphene nanoribbons with zigzag edges have been investigated using density functional theory calculations. For the optimized geometry configurations, vibrational frequency analysis and wavefunction stability tests have been carried out. Different doping site optimizations for a model nanoribbon have been performed and formation energy values of these sites revealed that zigzag edgesite for both of the dopants were the most favorable one. The effect of doping on the molecular orbital energies, HOMO-LUMO distributions, and density of states have been Studied as well. It is found that molecular orbital distributions for pure zigzag nanoribbons are located in the zigzag edges while they exhibit different behaviors for the doped cases. (C) 2009 Elsevier B.V. All rights reserved.