We have investigated the cross-sectional electric field and potential distribution of a cleaved n+-InP/InGaAsP/p+-InP p–i–n laser diode using Kelvin probe force microscopy (KFM) with a lateral resolution reaching 50 nm. The powerful characterization capabilities of KFM were compared with two-dimensional (2D) physics-based simulations. The agreement between simulations and KFM measurements regarding the main features of the electric field and potential is very good. However, the KFM yields a voltage drop between n- and p-doped InP regions which is 0.4 times the one simulated. This discrepancy is explained in terms of surface traps due to the exposure of the sample to the air and in terms of incomplete ionization. This hypothesis is confirmed by the 2D simulations. © 2000 American Institute of Physics.