Optimizing structure and surface morphologies in electrocatalyst design are important to enhance the intrinsic activity of the hydrogen evolution reaction (HER). Mo-based phosphides and carbides have been confirmed as the widely-reported catalysts for HER. However, the origin of their enhanced catalytic activity is not fully clarified. Herein, the np-FeMoC and np-FeMoP with a self-supporting nanoporous structure were prepared using the melt-spinning and dealloying methods. Benefiting from the self-supporting electrode, nanoporous structure, abundant active species, low charge-transfer resistance and electron synergy, the np-FeMoC exhibits good catalytic performance. The np-FeMoC performs a low overpotential of 50.8 mV at 10 mA cm−2 current density for HER in 1 M KOH. This value is 2.7 times lower than that of the np-FeMoP sample, indicating a synergistic effect between Mo2C and Fe. From XPS and in-situ Raman results, it was observed that the dissolution of Mo2C occurs accompanied by dynamic evolution during the HER process on the np-FeMoC surface. This work unveils the intrinsic activity of Mo-based carbide and phosphide, providing valuable guidance for reasonable exploit of high-performance HER catalysts.