Why the compound on the label matters
Magnesium is always bonded to something else, and that something determines both how much actual (elemental) magnesium you're getting and how well your gut absorbs it. Magnesium oxide, the cheapest and most common form on shelves, is poorly absorbed (around 4 percent in some estimates) and works mainly as a laxative, which is why it's also sold as a constipation remedy.
Magnesium glycinate (bound to the amino acid glycine) and magnesium citrate absorb considerably better and cause far less GI upset. Glycinate specifically is the form most associated with sleep and relaxation benefits, likely because glycine itself has calming, sleep-supportive properties independent of the magnesium.
What it's evidenced for
Dietary surveys consistently show a large share of adults fall short of the RDA (400-420mg/day for men, 310-320mg for women), largely because processed food strips magnesium out of grains and few people eat enough leafy greens, legumes, and nuts to close the gap. Correcting a real shortfall is associated with better sleep quality, fewer nighttime leg cramps, and modest blood pressure improvements in some trials.
The evidence for magnesium as a general anxiety or stress supplement in people who are not deficient is weaker and more mixed; it likely helps most in people starting from low levels, similar to the vitamin D pattern.
Dosing and safety
200-400mg of elemental magnesium in the evening, taken with food, is a reasonable starting point. Loose stool is the main sign you've gone too high, dial back if it happens. People with reduced kidney function should not supplement without medical guidance, since the kidneys are what clear excess magnesium and impaired clearance can lead to dangerous buildup.
