Poly(heptazine imide) (PHI) polymers have been widely studied, owing to their excellent activity as photocatalysts for various reactions. Their photocatalytic activity has been attributed to defects, optical absorption, or synergistic effects with ions in the reaction media. However, the role of the crystal structure of PHI in photocatalytic activity has not been elucidated. Herein, we reveal a direct correlation between the photocatalytic production of hydrogen (H 2 ) and the crystal structure of PHI. We synthesized polymeric carbon nitride materials focusing on different PHI (001)/(002) crystal plane ratios, high specific surface area, and enhanced light response by copolymerizing organic monomers in a KCl/LiBr molten salt medium. Theoretical and experimental results disclose that the charge carrier dynamics and electron mobility govern the photoactivity of PHI. The best photocatalyst, which had the highest abundance of PHI (100) planes, showed state-of-the-art performance for the hydrogen evolution reaction, with apparent quantum efficiencies of 15.6% at 405 nm and 1.32% at 595 nm, and for the production of H 2 O 2 in pure water under visible light (66.7 μmol g −1 h −1 ).