To overcome inherent limitations of molybdenum carbide (MoxC) for hydrogen evolution reaction (HER), i.e., low density of active site and nonideal hydrogen binding strength, we report the synthesis of valence-controlled mesoporous MoxC 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-b-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 degrees C. Theoretical calculations reveal that the hydrogen binding is strongly influenced by Mo valence. Consequently, MoxC achieves a significant increase in HER activity (exceeding that of Pt/C at high current density similar to 35 mA/cm(2) 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.