In this work, we investigate the effect of peripheral B doping on the electrocatalytic nitrogen reduction reaction (NRR) performance of N-doped graphene-supported single-metal atoms using density functional theory (DFT) calculations. Our results showed that the peripheral coordination of B atoms could improve the stability of the single-atom catalysts (SACs) and weaken the binding of nitrogen to the central atom. Interestingly, it was found that there was a linear correlation between the change in the magnetic moment (μ) of single-metal atoms and the change in the limiting potential (UL) of the optimum NRR pathway before and after B doping. It was also found that the introduction of the B atom suppressed the hydrogen evolution reaction, thereby enhancing the NRR selectivity of the SACs. This work provides useful insights into the design of efficient SACs for electrocatalytic NRR.