A low-cost, highly efficient and strong durable bifunctional electrocatalyst is crucial for electrochemical overall water splitting. In this paper, a self-templated strategy combined with in-situ phosphorization is applied to construct hollow structured bimetallic cobalt-nickel phosphide (CoN-iP x) nanocages. Owing to their unique hollow structure and bimetallic synergistic effects, the as-synthesized CoNiP x hollow nanocages exhibit a high electrocatalytic activity and stability towards hydrogen evolution reaction in all-pH electrolyte and a remarkable electrochemical performance for oxygen evolution reaction in 1.0 mol L −1 KOH. Meanwhile, with the bifunctional electrocatalyst in both anode and cathode for overall water splitting, a low voltage of 1.61 V and superior stability are achieved at a current density of 20 mA cm −2 .