Abstract A series of WS 2 /Co 9 S 8 nanoparticles (NPs) supported on N, S co‐doped mesoporous carbons were prepared via the molten salts process. Glucose, WCl 6 and CoCl 2 were used as carbon, tungsten and cobalt precursors, respectively. Thiourea were utilized as nitrogen and sulfur precursor. The common inorganic salts were the porogens, which can be removed and recycled. The molar ratio of the precursors can affect the porosities of the catalysts, which can further determine the electrocatalytic performance. The sample of G2.5TWCo shows the best HER performance due to the high electrochemically active surface area and low electrochemical impedance.