Development of transition metal phosphides with tunable morphology and chemical composition is a potential way to construct electrocatalysts with superior hydrogen evolution reaction (HER) activity in a wide range of pH values. In this work, vertical nanorods are constructed from nickel and iron phosphide grown on a carbon cloth (Ni2P-Fe2P/CC) via a hydrothermal treatment followed by low-temperature phosphorization method to achieve an effective catalyst for sufficient HER activity and strong stability. The Ni2P-Fe2P/CC exhibits remarkable overpotentials of 78, 80, and 87 mV to achieve a current density of 10 mAcm−2 in acidic, alkaline, and neutral electrolytes, respectively. Furthermore, it shows strong stability without significant performance change for 20 h, 30 h, and 30 h under 100 mAcm−2 in acidic, alkaline, and neutral electrolytes, respectively. This outstanding catalytic performance for HER in a wide pH range can be accredited to the synergistic effect induced by the coexistence of Ni and Fe atoms. Additionally, the integration of nanorods on the nanosheet also initiates fast transfer of hydrogen bubbles within the electrolyte, thereby enhancing its HER activity. The results present an opportunity to construct a low-cost, effective transition metal phosphide with unique architecture and strong durability for efficient HER activity in a wide range of pH values.