The dual?carbon strategy highlights the urgent need to develop efficient photocatalytic hydrogen production technologies. Graphitic carbon nitride (g?C?N?) has attracted wide attention due to its low cost and excellent stability, but it suffers from insufficient visible light absorption and rapid carrier recombination, which severely restricts its hydrogen production performance. To overcome these issues, we successfully prepared boron-doped g?C3N4 (BCN) using a H3BO3?assisted segmented temperature?controlled calcination strategy, with boric acid as the boron source precursor. The effects of boron doping on the band structure and photoelectric properties of g?C3N4 were systematically investigated through various photoelectric characterization techniques. The results demonstrate that an appropriate level of boron doping effectively modulates the electronic structure of g-C3N4, enhancing its visible light absorption and improving the separation efficiency of photogenerated carriers. Specifically, the BCN?2∶5 sample (with a mass ratio of H?BO? to g?C?N? of 2∶5) achieves a hydrogen evolution rate of up to 1 507 μmol/(g·h) under visible light irradiation. This study offers valuable insights and guidance for the design of highly efficient doped g?C3N4 photocatalysts.