Both operate on the same working principles of X-ray scattering. While X-ray fluorescence (XRF) provides the sample’s chemical composition and is used for rapid surface analysis of samples, X-ray diffraction (XRD) is often used to identify the crystalline phases, differentiate oxidation states, and obtain other crystallographic information.