Development of a low cost, high activity, and stable nonprecious metal bifunctional catalyst for electrocatalytic water cracking is a hot topic and big challenge. In this paper, we prepared a nitrogen-doped carbon nanotube (NCNT)-enhanced three-dimensional self-supported electrocatalyst with CoP and Co2P coexistence by a two-step strategy of high-temperature carbonization and low-temperature phosphorylation. Furthermore, the induced three-dimensional carbon network skeleton facilitates rapid charge transfer. In addition, the active sites of the carbon foam (CF) are greatly increased by the construction of hollow structures. As a bifunctional electrocatalyst, CoP/Co2P/NCNT@CF exhibited excellent catalytic activity for both hydrogen evolution reaction and oxygen evolution reaction in alkaline media, requiring low overpotentials of 133 and 289 mV to obtain a current density of 10 mA cm-2, respectively. Additionally, the synthesized catalysts also exhibit good long-term stability, maintaining high catalytic activity after 20 h of continuous operation. We also confirmed the main driving force to improve the electron transfer between the heterostructures of Co and P by XPS spectra. The excellent electrocatalytic performance can be attributed to the close synergy between the highly active CoP/Co2P/NCNT and CF. This study provides a new strategy for the design of highly active bifunctional self-supporting electrocatalysts.