Earth is the “blue planet,” with more than 70% of its surface covered in water and the equivalent of up to four oceans of water in its interior. This abundance of water has a profound impact on the processes that shape our planet as well as the development of the organisms that inhabit it. To understand this impact, it is necessary to know the properties and compositions of this fluid. At present, this information is largely unavailable, because direct samples of fluid are rare, especially for early Earth and Earth's interior, and other estimators are semiquantitative, at best. Here we propose a different approach in which the composition of the fluid is reconstructed from that of minerals, based on the characteristic trace element partitioning between minerals and aqueous fluids. We show experimentally that this partitioning is systematic and obeys lattice-strain theory. It depends strongly on element complexation in the fluid, but this dependence is predictable and can be accommodated. Unlike fluids, minerals with preserved compositions are readily available in the geological record, and this approach therefore provides a powerful and widely applicable tool to reconstruct a quantitative record of fluid composition for the full range of Earth environments and for its earliest history.