Given its clean energy and absence of exhaust gases, hydrogen is an ideal candidate for energy demand. Electrochemical hydrogen evolution reaction (HER) have attracted increasing attention, and non-precious metal compounds have been considered as next-generation catalysts to replace the traditional Pt-based catalysts in this reaction. This study adopts a novel sol-gel method of chitosan and formaldehyde to prepare an N-doped carbon matrix with Nickel phosphide (Ni2P) and Molybdenum phosphide (MoP) loading. Phytic acid is used as the P source to dissolve chitosan. The interface between Ni2P and MoP in the as-prepared catalysts facilitates HER with an excellent stability in a wide pH universal solution. The onset potentials of the catalyst are 300, 200, and 5 mV in 0.5 mol L-1 sulfuric acid, 1.0 mol L-1 phosphate buffer solution, and 1.0 mol L-1 potassium hydroxide, respectively, and the corresponding Tafel slopes are 63, 99, and 64 mV dec(-1). Density functional theory is adopted to support the experiment. Results suggest that the synergistic effect from the interface can obviously reduce the hydrogen adsorption free energy to benefit the adsorption/desorption. (C) 2020 Elsevier Ltd. All rights reserved.