The synthesis of active and stable electrochemical water splitting catalysts using the earth-abundant elements is the key to reduce the cost of hydrogen production. In this paper, a series of cobalt–nickel phosphide films was electrodeposited on nickel foam substrates (Co-Ni-P), and the resulting electrodes are active in catalyzing both the hydrogen evolution reaction (HER) and water oxidation reaction (WOR) in alkaline solutions. The most active electrode towards HER required 92 mV overpotentials to reach − 10 mA cm−2 current densities, and the Tafel slope was 87.6 mV dec−1. Meanwhile, for WOR, the most active electrode needed 277 mV overpotentials to reach the 10 mA cm−2 WOR current densities, with the Tafel slope at 63.6 mV dec−1. The excellent performance is mainly owing to the high number of electrochemically active sites endowed by the unique morphology, and the possible electron interaction between Co and Ni. Water electrolysis carried out using the most active electrodes exhibited 1.64 V (410 mV overpotentials) to reach the current density of 10 mA cm−2, which suggests the Co-Ni-P prepared using this method is a promising candidate as electrodes to catalyze overall water splitting.