Highlights •An anion co-doped strategy is presented to boost efficient and selective NH3 production.•The highly active surfaces of Cu(111) + O and Cu(111) + PO3 are built.•The P, O co-doped Cu nanocrystals catalyst achieves NH3 Faradaic efficiency up to 91.72 % and NO3− conversion rate of 91.09 % at high concentration electrolyte.•It is discovered that the P, O co-doped enables the down shift of the d-band center of active metal sites, favourably tuning reaction intermediates, particularly *NO3− and *NH3.•The anion co-doped concept could be extended to design other metal-based catalysts for wide range applications.