Abstract Sm 3+ doped CaO–MgO–Al 2O 3–SiO 2 glass and glass ceramics have been prepared. The diopside crystal (CaMgSi 2O 6) was identified in the glass ceramics by X-ray diffraction analysis. X-ray photoelectron spectra of the glass and glass ceramics were measured by a monochromatised Al-Kα XPS instrument. Sm 3d core level spectra for the Sm doped samples showed that Sm ions are predominantly in the Sm (III) state in glass and glass ceramics. The O 1s core spectra could be fitted by summing the contributions from bridging oxygen (BO) and non bridging oxygen (NBO) for samarium undoped glass, BO, NBO and Si–O–Sm for the doped glass. The O 1s XPS spectrum of undoped glass ceramics was curve fitted with BO and NBO in glass phase, as well as SiOSi, SiOMg and SiOCa in diopside. In addition to the five components above mentioned, SiOSm in diopside also appeared in O 1s XPS spectra of samarium doped glass ceramics. According to the fitting results, we demonstrate that the Sm 2O 3 exist in glass network as a glass modifier. After heat treatment, nearly all the Sm 3+ existed in diopside phase as the substitution for Ca 2+.