The effect of oxygen doping on the electronic and geometric structures of monolayer graphitic carbon nitride was calculated by first principle. It reveals the favorable O doping configurations over all the Fermi levels utilizing the Ab initio thermodynamics approach. The valence charge density difference contour map presents a weaker covalent nature on O–C bonds for ON2-doped structure and a complex ionic-covalent character associated with O–N2 bonds for Oi-doped structure. Based on the analysis of the electronic structures of the doped and un-doped systems, it is found that O doping facilitates the visible-light absorption of monolayer g-C3N4. Especially, Oi doping shows an intrinsic semiconductor behavior and the occupied doping band can be avoided to be the recombination center. In addition, O doping causes slightly stronger delocalization of the HOMO and LUMO which facilitates the enhancement of the carrier mobility. Moreover, Oi doping can induce more activity sites, and, thus, is beneficial for the separation of photogenerated e−/h+ pairs to some extent.