Graphitic carbon nitride (g-C3N4) is considered as a promising heterogeneous catalyst for photocatalytic H2 evolution from water under visible light illustration, and its photocatalytic performance could be controlled through its texture and optical/electronic properties. Herein, we present a facile one-step heating method for the synthesis of B/P/F doped g-C3N4 photocatalysts (BCN, PCN, and FCN). The prepared photocatalysts were characterized by XRD, SEM, UV-vis absorption, FTIR, BET, XPS, PL, and photocurrent measurement. The results show that the B/P/F doping increased the interplanar stacking distance of g-C3N4, enlarged the optical absorption range, and improved the photocatalytic activity of H2 evolution. FCN exhibits the highest photocatalytic activity, followed by BCN, and PCN that has the lowest performance. This work studies the doping effects of the nonmetal elements on the photocatalytic activities, the electronic structures as well as the band gaps of g-C3N4, to provide a feasible modification pathway to design and synthesize highly efficient photocatalysts.