Dual-phase B-doped FeCoNiCuPd high-entropy alloy (DP-B-HEA) nanoparticles were synthesized via a strategy involving thermodynamically driven solid-phase diffusion. The DP-B-HEA/CNFs showed an outstanding electrochemical N2 reduction reaction (NRR) performance with an ammonia yield of 24.8 μmol h-1 cm-2 and NH3 faradaic efficiency (FE) of 39.2%. The optimized electronic structures of the HEA resulting from B doping led to the enhanced NRR activity and selectivity.