To overcome inherent limitations of molybdenum carbide (Mo<sub><i>x</i></sub>C) for hydrogen evolution reaction (HER), <i>i.e.</i>, low density of active site and nonideal hydrogen binding strength, we report the synthesis of valence-controlled mesoporous Mo<sub><i>x</i></sub>C as a highly efficient HER electrocatalyst. The synthesis procedure uses an interaction mediator (IM), which significantly increases the density of active site by mediating interaction between PEO-<i>b</i>-PS template and Mo source. The valence state of Mo is tuned by systematic control of the environment around Mo by controlled heat treatment under air before thermal treatment at 1100 °C. Theoretical calculations reveal that the hydrogen binding is strongly influenced by Mo valence. Consequently, Mo<sub><i>x</i></sub>C achieves a significant increase in HER activity (exceeding that of Pt/C at high current density ∼35 mA/cm<sup>2</sup> in alkaline solution). In addition, a volcano-type correlation between HER activity and Mo valence is identified with various experimental indicators. The present strategies can be applied to various carbide and Mo-based catalysts, and the established Mo valence and HER relations can guide development of highly active HER electrocatalysts.