Photocatalytic nitrogen fixation has attracted great attention recently due to the mild condition with solar energy as the only energy input. In this work, the iodine-doped g-C3N4 with carbon vacancies has been successfully synthesized via a one-step thermal-decomposition method. The results showed that the band gap of g-C3N4 decreased and the average PL lifetime of g-C3N4 increased after iodine doping. This demonstrated the expansion of light responsive range and the high separation efficiency of the photo-generated charge carriers in iodine-doped g-C3N4. The g-C3N4 with 10 wt% iodine doping exhibited excellent performance and well stability for the photocatalytic nitrogen fixation under simulated sunlight irradiation within 3 h (200.8 mg/L/gcat), which is 2.8 times as high as that of bulk g-C3N4, owing to the reduced band gap, existence of carbon vacancies and enhanced separation efficiency of the photo-generated charge carriers. A feasible mechanism was proposed for photoinduced charge separation and nitrogen photofixation over iodine-doped g-C3N4.