The authors have performed a depth-profile analysis of an all-oxide p-n junction diode n-ZnO/p-NiO using photoemission spectroscopy combined with Ar-ion sputtering. Systematic core-level shifts were observed during the gradual removal of the ZnO overlayer, and were interpreted using a model based on charge conservation. Spatial profile of the potential around the interface was deduced, including the charge-depletion width of 2.3 nm extending on the ZnO side and the built-in potential of 0.54 eV. (c) 2006 American Institute of Physics.