Ammonia (NH3), which is an indispensable chemical, is produced by the Haber–Bosch process using H2 and N2 under severe reaction conditions. Although photocatalytic N2 fixation with water under ambient conditions is ideal, all previously reported catalysts show low efficiency. Here, we report that a metal-free organic semiconductor could provide a new basis for photocatalytic N2 fixation. We show that phosphorus-doped carbon nitride containing surface nitrogen vacancies (PCN-V), prepared by simple thermal condensation of the precursors under H2, produces NH3 from N2 with water under visible light irradiation. The doped P atoms promote water oxidation by the photoformed valence-band holes, and the N vacancies promote N2 reduction by the conduction-band electrons. These phenomena facilitate efficient N2 fixation with a solar-to-chemical conversion (SCC) efficiency of 0.1%, which is comparable to the average solar-to-biomass conversion efficiency of natural photosynthesis by typical plants. Thus, this metal-f...