Highly durable and earth-abundant bifunctional catalysts with low cell voltage are desirable for alkaline overall water splitting in the industrial fields. Herein, a novel carbon-based CoP hybrid with spatial compartmentalization of CoP nanoparticles (NPs) in P-doped dual carbon shells is achieved via a cheap Co−glycerate-template strategy. Benefitted from the uniform atomic blending of Co 2+ ions in the Co−glycerate precursors, CoP NPs in situ formed in the confined space with NaH 2 PO 2 as phosphorus source during the annealing process; meanwhile, glycerate suffered carbonization and transformed into P-doped dual carbon shells during the annealing process, including interior thin carbon coating, closely encircled CoP NP, and peripheral hollow carbon sphere loading a lot of CoP NPs. Not only does spatial compartmentalization of CoP NPs avoid the aggregation and expose more active sites but also P-doped dual carbon shells improve the conductivity and durability of the catalyst. As expected, the optimized hybrid exhibits outstanding electrocatalytic activities in alkaline media, such as hydrogen evolution reaction (HER) overpotential of 101 mV, oxygen evolution reaction (OER) overpotential of 280 mV, and a low cell voltage of 1.66 V to deliver a current density of 10 mA cm −2 . Moreover, durability and stability are greatly improved under harsh electrochemical conditions. The current strategy shades new insight into the development of carbon-based transition metal phosphides (TMP) catalysts for electrocatalysis applications.