Ammonia is used extensively as a raw material for fertilizers and industrial production. However, the ammonia yield of the traditional ammonia production process is far from reaching the requirements of industrial applications. Among various methods, electrochemical ammonia synthesis is the most anticipated. Density functional theory (DFT) calculations show that nanoscaled palladium (Pd) decorated on boron–carbon-nitrogen (BCN) support has great catalytic activity towards nitrate electrochemical reduction. We designed and synthesized the BC2N/Pd (both B and N atomic loading more than 20%) electrocatalysts and applied them to electrochemically convert harmful nitrate to high value-added ammonia, which performed an excellent ammonia yield rate of 1730 μg h−1 cm−2 and a high Faraday efficiency of 97.42% in water that containing 250 mM KNO3. Isotope labeling experiments proved that ammonia originates from nitrate reduction. At the same time, BC2N/Pd also exhibits splendid stability and durability. The outstanding electrocatalytic activity suggests good prospects in industrial applications, including the purification of ammonia and nitrate wastewater.