The elementary valence state in electrocatalysts has been demonstrated to significantly affect their catalytic ability. However, enhancing performance by controlling the elemental valence state and the precise doping location remains challenging. This work is devoted to exploring a controllable electronic structure that is capable of improving electrocatalytic hydrogen evolution activity by manipulating the valence state of an element at a specific location. This is demonstrated by reducing the high valence state Co3+ in octahedral sites of Co9S8 to form low valence state Co2+ using sodium borohydride. The occupation of Co2+ in the Co3+ site gives rise to the generation of local lattice distortion, which provides more efficient active sites for the hydrogen evolution reaction (HER). Additionally, Co2+ in octahedral sites donates more electrons to adsorbed water molecules, which facilitates HO–H dissociation and H∗ adsorption. The resulting electrocatalyst exhibits a low overpotential of 301 mV at 500 mA/cm2 for the HER, which is the best performance among all reported single-component Co9S8-based catalysts. This work paves an avenue for the rational design of HER electrocatalysts by precisely tuning the valence state of elements at specific locations.