Water electrolysis is a sustainable and clean method to produce hydrogen fuel via hydrogen evolution reaction (HER). Using stable, effective and low-cost electrocatalysts for HER to substitute expensive noble metals is highly desired. In this paper, by using first-principles calculation, we designed a defect and N-, S-, P-doped penta-graphene (PG) as a two-dimensional (2D) electrocatalyst for HER, and its stability, electronic properties and catalytic performance were investigated. The Gibbs free energy (ΔGH), which is the best descriptor for the HER, is calculated and optimized, the calculation results show that the ΔGH can be 0 eV with C2 vacancies and P doping at C1 active sites, which should be the optimal performance for a HER catalyst. Moreover, we reveal that the larger charge transfer from PG to H, the closer ΔGH is to zero according to the calculation of the electron charge density differences and Bader charges analysis. Ulteriorly, we demonstrated that the HER performance prefers the Volmer–Heyrovsky mechanism in this study.