longevitywatch

When should you take magnesium for sleep?

Preliminary evidence

Take magnesium about an hour before bedtime, but do not expect a guaranteed effect: the evidence is thin and a substantial placebo effect is likely playing a role.

Magnesium works best for sleep when taken in the evening, about an hour before bedtime. This is supported by a study that used a combination supplement (containing melatonin and zinc): participants took it one hour before sleep, over a period of eight weeks. Taking it at a fixed time close to bedtime also helps build a consistent sleep routine.

On the question of whether magnesium genuinely works better than nothing, findings are mixed. Three small studies in older adults with sleep problems show that magnesium reduces the time it takes to fall asleep by an average of about 17 minutes. However, in a separate study the placebo group improved just as much as the magnesium group, suggesting that a large part of the effect is driven by expectation. A large population study found no better sleep among magnesium users, and, notably, those users actually reported leg cramps at night more often.

If you still want to try whether magnesium helps your sleep problems, you can opt for 320 to 500 mg of elemental magnesium per day, in the form of citrate or oxide (as stated on the label). Stick with it for at least eight to twelve weeks before drawing any conclusions. Magnesium oxide has the poorest absorption of all forms, while citrate is better absorbed. The ratio of calcium to magnesium in your diet makes no demonstrable difference for sleep.

For people with diabetes there is somewhat more to go on: one study in 290 people with diabetes showed that magnesium (sometimes combined with potassium) reduced insomnia and raised the sleep hormone melatonin, while the stress hormone cortisol decreased. This does concern a specific group and a medical condition, so discuss it with your doctor if you have diabetes and are sleeping poorly.

The evidence
21 studies · 2 meta-analyses · 3 randomised trials · ≈ 12,000 participants

This answer draws on three pooled analyses of multiple studies, supplemented by individual randomised trials and one large population study. The authors of the most relevant pooled analysis themselves rate all trials as having a moderate to high risk of bias, and describe the quality of the evidence as low to very low. This makes the 17-minute gain in time to fall asleep less certain than the number suggests. Results for the general population are contradictory, and magnesium is not recommended as a standard approach to sleep problems by the most recent broad analysis.

Last checked: October 2026 · how this was judged
Related answers

Is it better to take magnesium in the evening?

Does magnesium help with poor sleep and muscle cramps, and which form should you take?

Does magnesium really help you sleep better and keep your mind sharp?

Does magnesium glycinate help you sleep better?

How much melatonin should you take to sleep better?

All Magnesium answers on “What works” →
Related research
11 Oct
Winter sleepiness has a biological circuit in the brain
28 Sep
Fragmented sleep erases memories via dopamine circuit
25 Sep
Sleep rhythm controls metabolism at the cellular level
Don't see your question?
Ask it and we'll look it up for you.
Ask a question →
Newsletter

Stay in the loop

Every Thursday, the most important longevity research in your inbox, focused on what you follow.