N doping in graphene can be achieved using a facile and mild approach using electrochemical energy at room temperature with ammonia as the N source, which occurs at the carbon active sites generated in situ during the removal of oxygen containing species at cathodic potentials.