The structural properties of the hydrated lanthanoid(III) ions in aqueous solution and in the isostructural trifluoromethanesulfonate salts have been investigated by a quantitative analysis of the X-ray absorption near-edge structure (XANES) spectra at the K- and L(3)-edges. The XANES analysis has provided a clear description of the variation of lanthanoid(III) hydration properties across the series. It was found that all of the lanthanoid(III) hydration complexes retain a tricapped trigonal prism (TTP) geometry, and along the series two of the capping water molecules become less and less strongly bound, before finally, on average, one of them leaves the hydration cluster. This gives rise to an eight-coordinated distorted bicapped trigonal prism with two different Ln--O capping distances for the smallest lanthanoid(III) ions. This systematic study has shown that for lanthanoid compounds more accurate structural information is obtained from the analysis of the L(3)-edge than from K-edge XANES data. Moreover, whereas the second hydration shells provide a detectable contribution to the L(3)-edge XANES spectra of the lighter lanthanoid ions, the K-edge spectra are insensitive to the more distant coordination spheres.