Oxygen-doped graphene (O-G) derived from sodium gluconate is identified as a promising candidate to effectively catalyze ambient electrohydrogenation of N2 to NH3. Electrochemical tests on O-G in 0.1 M HCl suggest a large NH3 yield of 21.3 μg h-1 mgcat.-1 and a high faradaic efficiency of 12.6% at -0.55 and -0.45 V vs. reversible hydrogen electrode, respectively, with strong electrochemical and structural stability in 0.1 M HCl. Density functional theory calculations reveal the NRR catalytic mechanism and suggest that both the C[double bond, length as m-dash]O and O-C[double bond, length as m-dash]O groups contribute more greatly to the NRR compared with the C-O group.