Recent reports of approximately 30 wt% of sulphate within saline sediments on Mars--probably occurring in hydrated form--suggest a role for sulphates in accounting for equatorial H2O observed in a global survey by the Odyssey spacecraft. Among salt hydrates likely to be present, those of the MgSO4*nH2O series have many hydration states. Here we report the exposure of several of these phases to varied temperature, pressure and humidity to constrain their possible H2O contents under martian surface conditions. We found that crystalline structure and H2O content are dependent on temperature-pressure history, that an amorphous hydrated phase with slow dehydration kinetics forms at <1% relative humidity, and that equilibrium calculations may not reflect the true H2O-bearing potential of martian soils. Mg sulphate salts can retain sufficient H2O to explain a portion of the Odyssey observations. Because phases in the MgSO4*nH2O system are sensitive to temperature and humidity, they can reveal much about the history of water on Mars. However, their ease of transformation implies that salt hydrates collected on Mars will not be returned to Earth unmodified, and that accurate in situ analysis is imperative.