One of the biggest challenges to the sustainable manufacture of liquid ammonia and the prevention of worldwide water contamination is the development of effective electrocatalysts for the electrochemical reduction of nitrate (NO3−) to NH3 with high stability. Herein, a highly active and serviceable electrocatalyst is synthesized by pyrolysis, composed of nanostructure nickel phosphide (Ni2P) embedded in nitrogen phosphide doped carbon (NPC) followed by deposition on carbon paper (CP) to improve the electrocatalytic nitrate reduction. Various characterization techniques investigate the crystallinity, morphology, and chemical components of the Ni2P-NPC/CP nanoparticles. The results support the formation of nanostructure Ni2P and strong synergistic interactions between Ni2P and NPC, which resulted in substantial active sites and high electrical conductivity. Excellent performance of Ni2P-NPC/CP nanoparticles is achieved for electrocatalytic NO3− reduction with an NH4+ yield rate of 2.468 mg h−1 mgcat.−1 and Faradaic efficiency (FE) of 84.6% at −1.2 V vs. RHE. Additionally, Ni2P-NPC/CP nanoparticles exhibit exceptional robustness and endurance. Studies using isotope labeling have been carried out, and the results show that nitrate reduction produces ammonia. Ni2P-based electrocatalysts can effectively treat nitrate wastewater to recover ammonia and facilitate its use in diverse industrial applications.