Nematicity is ubiquitous in electronic phases of high-T_{c} superconductors, particularly in the Fe-based systems. We used inelastic x-ray scattering to extract the temperature-dependent nematic correlation length ξ from the anomalous softening of acoustic phonon modes in FeSe, underdoped Ba(Fe_{0.97}Co_{0.03})_{2}As_{2}, and optimally doped Ba(Fe_{0.94}Co_{0.06})_{2}As_{2}. In all cases, we find that ξ is well described by a power law (T-T_{0})^{-1/2} extending over a wide temperature range. Combined with the previously reported Curie-Weiss behavior of the nematic susceptibility, these results point to the mean-field character of the nematic transition, which we attribute to a sizable nematoelastic coupling that is likely detrimental to superconductivity.