This article describes the results of a detailed study of semiconductor dopant profiling with the scanning electron microscope (SEM) using secondary electrons. The technique has been applied to a wide variety of doped silicon test structures as well as a metal-oxide field-effect transistor. We have demonstrated that contrast can be detected from p-doped regions as thin as one nanometer across. Contrast can also be measured from p-type regions with doping concentrations less than 10(16) cm(-3). We have studied the variation of doping contrast with specimen temperature and with a bias applied across a p-n junction in situ in the SEM. These experiments demonstrate that doping contrast is mainly due to the built-in voltages in semiconductor devices which result in local fields (patch fields) outside the specimen which influence the number of secondary electrons detected. A concise set of guidelines is provided for users of this technique, including the optimum SEM operating conditions that should be used for maximum contrast. (C) 2002 American Institute of Physics.