Metal–carbon heterostructured Cu@NxC catalysts with precise regulation of the N content are constructed. The optimized Cu@N1.0C electrocatalyst converts NO3− to NH3 with a high FENH3 of 96.2% at −0.9 V vs. RHE, and NH3 yield rate is 1353.1 mmol h−1 gcat−1 at −1.1 V vs. RHE.