Magnesium sulfate, commonly known as Epsom salt, is a mineral. It works by replacing magnesium in the body and increasing water in the intestines. Magnesium sulfate can be used orally as a laxative to relieve occasional constipation, and to treat low levels of magnesium. ... Some people use Epsom salts as a bath soak.