Sensitization in stainless steels is caused by the formation of chromium-rich M23C6 carbides at grain boundaries, which depletes the adjacent matrix and boundary region of chromium, and hence leads to rapid intergranular attack. To fully understand the sensitization process, and to test the accuracy of theories proposed to model this process, it is necessary to obtain very accurate measurements of the chromium concentration at grain boundaries in sensitized specimens. Quantitative X-ray spectroscopy in the analytical electron microscope (AEM) enables the chromium concentration profile across these boundaries to be studied directly; however, it has been shown that a strong effect of foil thickness and electron probe size may be present in the analysis of rapidly-changing compositional gradients. The goal of this work is to examine these effects.