We perform first‐principles calculations to investigate whether or not nitrogen is the best dopant in system of Co−X4 embedded graphene (X=N, S, B, and P) electrocatalysts towards hydrogen evolution reaction(HER). Our theoretical results reveal that N, S, B, and P‐doped graphene can enhance the catalytic activity toward HER compared with the pristine graphene, and S doped graphene exhibits more favorable performance than N doped graphene, consistent with the experimental results. For the Co−X4 embedded graphene (X=N, S, B, and P), we predict that S may be a promising dopant in graphene supported single atom Co. The rather low hydrogen adsorption free energy (−0.07 eV) and activation energy barrier (0.78 eV) for the rate‐determining step, the downshift of the d band center, the enhanced charge density of dz2 orbital as well as the reduced work function are responsible for the unexpected activity of Co‐S4 embedded graphene for HER. Overall, Co‐S4 embedded graphene catalyst could be a good candidate for hydrogen evolution reaction. [ABSTRACT FROM AUTHOR]