Does magnesium help you fall asleep faster?
Yes, the most consistent finding is that magnesium can shorten the time it takes to fall asleep. A meta-analysis of three randomized controlled trials in older adults found that taking oral magnesium reduced sleep onset latency by an average of 17.36 minutes compared to a placebo [5]. That's a meaningful improvement for someone who lies awake for an hour or more.
This effect is supported by other studies. A 2024 crossover trial in adults with poor sleep showed that magnesium supplementation led to significant improvements in sleep duration and deep sleep measured objectively with a sleep ring [6][9]. Another trial in elderly insomniacs found that 500 mg of magnesium daily for 8 weeks significantly improved scores on the Leeds Sleep Evaluation Questionnaire, which measures how easily you fall asleep [8].
Who is most likely to benefit from magnesium for sleep?
The evidence strongly suggests that people with low magnesium levels see the biggest benefit. Several large observational studies found that lower dietary magnesium intake or lower blood magnesium levels are linked to worse sleep quality and shorter sleep duration [1][4][7][11][12]. For example, a study of over 21,000 people found that those with the highest magnesium intake were 36% less likely to report short sleep (under 7 hours) [1]. Similarly, airline pilots with poor sleep had significantly lower blood magnesium levels than those who slept well [11].
However, if your magnesium levels are already normal, supplementation may not help. A randomized trial in women with PCOS found that 250 mg of magnesium daily for 10 weeks had no effect on sleep quality [2]. Another large analysis of NHANES data found that magnesium supplements were not associated with better sleep duration or fewer sleep disorders in the general population [4]. This suggests magnesium is not a universal sleep aid—it works best when you have a deficiency.
Does magnesium improve overall sleep quality and daytime function?
The evidence is mixed but leans toward a small positive effect on sleep quality. A 2024 crossover trial found that magnesium significantly improved scores on the Pittsburgh Sleep Quality Index (PSQI), a standard measure of sleep quality, compared to placebo [6][9]. A study in diabetic patients with insomnia found that magnesium (alone or with potassium) significantly reduced insomnia severity and improved sleep duration [3].
However, not all studies agree. The same 2024 crossover trial found no significant improvement on the Restorative Sleep Questionnaire or measures of anxiety and stress [6][9]. And a systematic review of the entire literature concluded that while observational studies show a link between magnesium and better sleep, the randomized trials are contradictory and of low quality [10]. The bottom line: magnesium may improve how you feel about your sleep, but the effect is not dramatic.
About These Sources
This answer is built on 12 peer-reviewed studies — published from 2021 to 2026, 6 from 2024 or later, 3 in Q1 journals, collectively cited 161 times — selected as the most relevant from 15 studies that passed quality screening, drawn from 46 papers retrieved from a database of over 500 million.
Sources used in this answer
Association of magnesium intake with sleep duration and sleep quality: findings from the CARDIA study
In a large longitudinal study of 3,964 adults, higher magnesium intake was associated with a 36% lower odds of short sleep (<7 hours) and a borderline improvement in sleep quality [1].
Effect of magnesium supplementation in improving hyperandrogenism, hirsutism, and sleep quality in women with polycystic ovary syndrome: A randomized, placebo‐controlled clinical trial
A randomized trial in 64 women with PCOS found that 250 mg/day of magnesium for 10 weeks had no significant effect on sleep quality compared to placebo [2].
Effects of magnesium and potassium supplementation on insomnia and sleep hormones in patients with diabetes mellitus.
In a randomized trial of 290 diabetic patients with insomnia, magnesium supplementation (alone or with potassium) significantly reduced insomnia severity and improved sleep duration [3].
Dietary Magnesium Intake Is Associated With Self-Reported Short Sleep Duration but Not Self-Reported Sleep Disorder.
Analysis of 21,840 NHANES participants found that dietary magnesium intake was independently associated with normal sleep duration, but magnesium supplements showed no association with sleep duration or disorders [5].
Oral magnesium supplementation for insomnia in older adults: a Systematic Review & Meta-Analysis
A meta-analysis of 3 RCTs in 151 older adults found that oral magnesium reduced sleep onset latency by 17.36 minutes, but total sleep time improvement was not statistically significant [6].
Effectiveness of Magnesium Supplementation on Sleep Quality and Mood for Adults with Poor Sleep Quality: A Randomized Double-Blind Placebo-Controlled Crossover Pilot Trial
A crossover trial in 31 adults with poor sleep found that 1 g/day of magnesium significantly improved sleep quality, sleep duration, deep sleep, and sleep efficiency measured by a sleep ring [7].
Serum magnesium levels and their association with sleep quality and disease severity in fibromyalgia syndrome: An observational cross-sectional study.
In a cross-sectional study of 82 fibromyalgia patients, lower serum magnesium levels were significantly correlated with poorer sleep quality (PSQI), higher pain, and greater functional impairment [8].
Therapeutic Effect of Magnesium Supplementation in Improving Quality of Life among Elderly Insomniac Participants
A double-blind RCT in 80 elderly insomniacs found that 500 mg/day of magnesium for 8 weeks significantly improved sleep quality scores and increased serum melatonin levels [9].
Effectiveness of Magnesium Supplementation on Sleep Quality and Related Health Outcomes for Adults with Poor Sleep Quality: A Randomized Double-Blind Placebo-Controlled Crossover Trial
A crossover trial in 31 adults with poor sleep found that magnesium supplementation significantly improved sleep quality, mood, and activity outcomes compared to placebo [10].
The Role of Magnesium in Sleep Health: a Systematic Review of Available Literature
A systematic review of 9 studies concluded that observational studies link magnesium status to sleep quality, but randomized trials show contradictory findings and the overall evidence is low quality [12].
Serum Calcium and Magnesium Levels, Not 25-Hydroxyvitamin D, Are Associated With Sleep Quality in Airline Pilots
In a cross-sectional study of 100 airline pilots, those with poor sleep had significantly lower serum magnesium levels (1.8 vs 2.0 mg/dL) than good sleepers [13].
Magnesium and Zinc Are Associated with Sleep Quality in Saudi Adults: Evidence from a Cross-Sectional Study.
In a cross-sectional study of 1,041 Saudi adults, serum magnesium deficiency (<1.8 mg/dL) was associated with 1.8-fold higher odds of poor sleep, and low dietary magnesium was also independently linked to poor sleep [14].
