Magnesium sulfate is an inorganic salt with the formula MgSO4(H2O)x where 0≤x≤7. It is often encountered as the heptahydrate sulfate mineral epsomite (MgSO4·7H2O), commonly called Epsom salt.