The development of two-dimensional (2D) materials with high conductivity and catalytic activity is important for the proposed hydrogen economy. Herein, we design a new family of 2D monolayers, pentagonal transition-metal borides/carbides (penta-TMBs and penta-TMCs), as electrocatalysts for the hydrogen evolution reaction (HER) on the basis of density functional theory (DFT). We find that all of the stable 2D penta-TMBs/TMCs are metallic, and 2D WB and HfC are ferromagnetic metals. We demonstrate that penta-TMBs and penta-TMCs show high catalytic performance for the HER. The Gibbs free energy for the adsorption of hydrogen atoms on catalyst surfaces (such as WB and ZrC) is close to the ideal value of zero electron volt (eV). Our findings highlight a new family of promising noble metal-free HER catalysts and provide new insight into the design of advanced 2D materials.