We report on the application of electrostatic force microscopy to photovoltaic devices. Profiles of electrical potentials on cross sections of a GaInP2 solar cell device were measured quantitatively and spatially resolved. Two potentials are assigned, respectively, to the p-n junction of GaInP2 and the band offset between the GaInP2 base layer and the GaAs substrate. In addition to the flattening of the p-n junction by the light irradiations, two changes of the potential that positively contribute to the open-circuit voltage of the device are found at locations close to the window and the back surface field layers. (C) 2002 American Institute of Physics.