Polymeric carbon nitride (CN) has emerged as a promising semiconductor in photoanodes for photoelectrochemical cells (PEC) owing to its suitable electronic structure, tunable band gap, high stability, and low price. However, the poor electron diffusion within the CN layer and hole extraction to the solution still limit its applicability in PECs. Here, we report the fabrication of a CN photoanode with excellent electron diffusion length and remarkable hole extraction properties by careful design of its electronic interfaces. We combine complementary synthetic approaches to grow tightly packed CN layers forming a type-II heterojunction, which results in a CN photoanode with excellent charge-separation, high electronic conductivity, and remarkable hole extraction efficiency. The optimized CN photoanode displays excellent PEC performance,