We classify all functions which, when applied term by term, leave invariant the sequences of moments of positive measures on the real line. Rather unexpectedly, these functions are built of absolutely monotonic components, or reflections of them, with possible discontinuities at the endpoints. Even more surprising is the fact that functions preserving moments of three point masses must preserve...