Graphitic carbon nitride (g-C3N4, CN) with nitrogen vacancies was synthesized by a controlled thermal etching method in a semi-closed air-conditioning system. The defect-modified g-C3N4shows an excellent photocatalytic performance demonstrated by water splitting under visible light irradiation. With proper heat-treatment durations such as 2 h (CN2) and 4 h (CN4) at 550 °C, the hydrogen production rates significantly increase to 100 µmol h-1and 72 µmol h-1, which are 11 times and 8 times the rate of the pristine CN (8.8 µmol h-1) respectively. The excellent hydrogen production performance of nitrogen defect modified CN2 is due to the synergy effect of the decreased band gap, enlarged specific surface area and increased separation/migration efficiency of photoinduced charge carriers. This simple defect engineering method provides a good paradigm to improve the photocatalytic performance by tailoring the electronic and physical structures of g-C3N4.