Does magnesium really help you sleep better and keep your mind sharp?
Magnesium may help with sleep problems, but the evidence is still too limited and inconsistent to make firm claims. If you want to try it, supplements at normal doses are safe; in any case, make sure you get enough through your diet.
People who consume more magnesium tend to sleep better on average and are less likely to get too little sleep. In a large study of nearly 4,000 people, those with the highest magnesium intake were 36% less likely to get an insufficient night's sleep. However, these are associations from observational research, which means that magnesium being the cause has not been established.
When you look at actual experiments with magnesium supplements, the picture is mixed. In older adults with insomnia, three small randomised studies combined showed that magnesium reduced the time it takes to fall asleep by an average of 17 minutes. That is statistically detectable, but the researchers themselves rate the quality of the evidence as low to very low, and all three studies had a moderate-to-high risk of design flaws. A study involving 290 diabetes patients showed more favourable results: less insomnia, more melatonin, and lower cortisol. However, diabetes patients have a magnesium deficiency more often than healthy people, so this effect does not automatically apply to everyone.
One finding stands out: a magnesium deficiency is associated with a threefold higher risk of sleep apnoea. That association was not present for insomnia or simply getting too little sleep. This does not mean that magnesium helps with sleep apnoea itself; it is an observed association, not a proven cause.
For 'a sharp mind' during the day, the studies provided contain no direct evidence. You could reason indirectly that sleeping better also benefits cognition, but that is not something these studies demonstrate. What is supported separately: magnesium appears to help prevent migraines and is mentioned for that purpose in general practitioner guidelines as an alternative preventive treatment.
In terms of safety: doses of less than 1 gram per intake are well tolerated. Magnesium from food is practically risk-free. High doses of supplements can cause diarrhoea, but this is not reported as a major problem in these studies.
Sources used: one meta-analysis of 3 small RCTs (n=151, PMID 33865376), one broad supplement meta-analysis (31 RCTs, PMID 33441476), one large cohort study CARDIA (n=3,964, PMID 34883514), one large cross-sectional study NHANES (n>20,000, PMID 38703902), one RCT in diabetes patients (n=290, PMID 39534260), plus observational and narrative reviews (PMID 35184264, 40728459, 40378325).