Conversion of nitrogen to ammonia (NH3) is one of the most important issue in the modern chemical industry. Transition metals (TM) have the special unoccupied and occupied d orbitals to accept the electrons from and backdonate to N2, which is crucial in effective nitrogen reduction reaction (NRR). Herein, we propose TMN4 (TM=Fe, Co, Mo, W, Ru, Rh) embedded graphene as the catalysts for NRR by using the density functional theory calculations. Our results revealed that MoN4 embedded graphene exhibited outstanding catalytic activity for ammonia synthesis at ambient conditions along with small reaction energy barrier of 0.67 eV, as well as against hydrogen evolution reaction. These findings provide a potential paradigm for NRR.