Biomass, as a low-cost, environmental friendly and renewable carbon source with natural porous structure can be used as carriers. Molybdenum carbide (Mo2C), possessing metallic characteristics and a platinum-like d-band electronic structure, has recently emerged as promising candidate for hydrogen evolution reaction (HER). In this study, we fabricate a new electrocatalyst by embedding ruthenium (Ru) into Mo2C on carbonized coconut shell (Ru-Mo2C@CSC). Doping of Ru into Mo2C significantly activates the inherent HER activity by altering the surface state, which enhances electron accumulation and transfer between the intermediate and electrocatalyst surface. The obtained Ru-Mo2C@CSC exhibit a remarkably low overpotential of 40 mV at 10 mA cm−2 in 1 M KOH, matching the benchmark Pt/C. Both experimental and density functional theory (DFT) reveal that this outstanding electrocatalytic activity stems from its unique three-dimensional (3D) architecture and the altered electronic structure by Ru-doping. The distinct 3D hierarchical porous structure aids electrolyte penetration, increases exposure of active sites, and facilitates the release of gas products. Substituting Ru atoms notably diminish the proton adsorption strength at the Mo and C atom coordination sites and electronic modification of Mo by charge transfer from Ru to Mo which was observed by X-ray photoelectron spectroscopy. A synergetic interaction at the Ru-Mo interface is generated to optimize the adsorption–desorption energetics toward H intermediate and accelerate water dissociation.