Contact potential difference (CPD) measurements of the relative work functions of a range of organic semiconductor thin films show that oxygen causes effective p-type doping (with work functions increasing 0.1–0.3eV). This doping effect is found to be reversible by exposure to high vacuum or heating in inert atmosphere. The mechanism of doping is explained by a model, based on a reversible formation of an O-substrate charge transfer state. Conductivity measurements of p-phthalocyanine films at variable temperatures support this doping model. The oxygen doping effect is consistent with filling of tail states in the gap, as shown by the increase of activation energy of hole transport with decreased O-doping, and by the good fit between experimental data and simulations of the in-gap density of states. A model hybrid solar cell configuration also shows the effect of doping by O 2 and corroborates the fact that O-doping fills the tail states in the system.