The development of low-cost, highly active, and robust electrocatalysts for catalyzing the hydrogen evolution reaction (HER) and oxygen evolution reaction (OER) holds a pivotal role in electrocatalytic water splitting. Herein, a two-step method was presented to synthesize CoS2/CoP heterostructures grown on carbon cloth (CoS2/CoP/CC). The precursor Co(OH)F/CC synthesized through the hydrothermal process can be successfully converted into CoS2/CoP/CC catalyst via gas-phase phosphorization and sulfurization. The as-obtained CoS2/CoP/CC exhibited promising performances for HER and OER with low overpotentials of 90 and 334 mV at a current density of 10 mA cm−2 in 1.0 M KOH, respectively. The improved electrocatalytic performance of the CoS2/CoP/CC can be attributed to the strong electron interactions and synergistic efforts between CoS2 and CoP, abundant active sites of the heterostructures, and enhanced smaller charge-transfer resistance.