The application of photoreflectance (PR) spectroscopy to metal-semiconductor field effect transistor and high electron mobility transistor structures is demonstrated. The line shape analysis relies on a new method for calculating PR spectra and electric field profiles of heterostructures with weakly inhomogeneous layers. The method allows inhomogeneous built-in electric field distributions below the surface to be detected. It can be used to determine characteristic parameters of device structures and to detect quantum states confined to potential wells. Differences between PR spectra from nominally identical or similar structures are attributed to different interface qualities.