The use of surface charging of a thin dielectric film on a semiconductor during x‐ray photoelectron spectroscopic analysis has been investigated. The binding energy shifts measured from 1.5 nm SiO2/p‐Si and 4 nm Si3N4/n‐InP indicate that a positive surface potential can be induced by the loss of photoelectrons in the dielectric, whereas a controllable negative potential can be applied by flooding the sample with low‐energy electrons. The measurements of the resultant depth‐dependent potentials in the oxide and in the semiconductor give useful information on the dielectric/semiconductor structure. For example, the results obtained using this technique show that in the case of SiO2/p‐Si, the Fermi level of the semiconductor at the interface was not pinned but in the case of Si3N4/n‐InP, it was pinned at 0.3 eV from the conduction‐band minimum. Moreover, the charging potential associated with a local impurity in the sample structure can be used to estimate the depth location of the impurity. Finally, the measurement of the degree of charging also gives information on the insulating properties of the dielectric.