Does magnesium help you sleep?
Short answer
Not clearly; trials disagree.
Some small trials found people fell asleep a bit sooner, but others found magnesium did no better than a placebo. The newest review of twelve trials found inconsistent results and weak evidence.
This page says what the research shows. It does not say whether you should take magnesium.
Where the evidence stands
Each dot is one on-topic paper. Steps near the top answer the question more directly. Select a dot to see the study.
↑ Stronger evidence
-
Trials in people: sleep quality and insomnia
Trials that measured sleep quality and insomnia directly.
1 -
Trials in people: other measures
Trials that measured other health or performance measures.
6 -
Trials in people: lab tests or safety
Trials that measured lab tests, side effects or safety.
0None among the papers we read.
-
Population studies
Studies that followed or surveyed groups of people. They show links, not causes.
3 -
Blood levels and genes
Studies that link blood levels or genes to health.
3
↓ Weaker evidence
- Points to benefit
- Mixed
- No difference
- No direction
- Points to harm
Not on the ladder: 3 reviews of many studies (shown below). Counts are papers, not people. Some studies appear in more than one paper.
See every studyWhat we found
- In three pooled trials of 151 older adults with insomnia, people on magnesium fell asleep 17.36 min sooner than on placebo; the trials had moderate-to-high risk of bias. Mah 2021
- In 96 adults over 51 with poor sleep, sleep scores improved from 10.4 to 6.6 with both magnesium and placebo, so magnesium showed no extra effect. Nielsen 2010
- A 2026 review of twelve trials of magnesium alone found inconsistent sleep results and low to very low certainty, and did not back it as routine insomnia treatment. Lopresti 2026
- A Swiss study of 3887 adults found no consistent link between taking magnesium supplements and sleep, measured by questionnaires or overnight sleep tests. Stadie 2026
What the research says
Trials in poor sleepers give mixed results
Three small trials in older adults with insomnia, pooled together, showed people fell asleep 17.36 min sooner on magnesium than on placebo. Total sleep time rose 16.06 min, but that gain was not clear. All three trials had moderate-to-high risk of bias.
In 96 adults over 51 with poor sleep, 320 mg a day for seven weeks did no better than placebo; both groups slept better. In 290 people with diabetes and insomnia, insomnia scores differed between the magnesium, potassium, combined and placebo groups after 2 months; the abstract gives no sizes.
Studies: Mah 2021, Nielsen 2010, Khalid 2024
Sleep was a side measure in other illnesses
In 175 people with night leg cramps, one 226 mg capsule at bedtime for 60 days improved sleep quality more than placebo. In 60 heart surgery patients, 500 mg a day gave better sleep scores (8.3 vs 10.3, lower is better), but the comparison group got no placebo.
In restless legs, sleep quality differed between magnesium, vitamin B6 and placebo groups only at month two. In fibromyalgia, 100 mg a day did no better than placebo on sleep. In depression, adding magnesium to fluoxetine cut depression scores more, especially mood and insomnia items.
Studies: Barna 2021, Saba 2022, Jadidi 2022, Macian 2022, Walyddaini 2026
Population studies show links, not causes
A Swiss study of 3887 adults found no consistent link between magnesium supplement use and sleep; users had more night cramps. In 613 Puerto Rican adults, supplement users without diabetes had lower odds of later insomnia, but there was no link in the whole group.
Among fibromyalgia patients, the 55 poor sleepers had lower blood magnesium than the 27 good sleepers. A US survey of 20,585 adults tied a score for low magnesium to sleep trouble and sleep apnea, but not to insomnia. These studies cannot show that magnesium causes better sleep.
Studies: Stadie 2026, Chen 2026, Alisik 2025, Luo 2024
Gene studies of blood magnesium disagree
One genetic study linked naturally higher blood magnesium to slightly lower odds of insomnia (OR = 0.869), with a range reaching 0.990, very close to no effect. A second genetic study of 15 nutrients, magnesium among them, found none linked to insomnia or sleep length.
Studies: Luo 2025, Zhang 2025
What reviews of many studies found
Reviews pool or sum up earlier studies. They are not on the ladder, because they repeat studies already counted there.
Systematic review · Lopresti 2026
Reviewed twelve trials of magnesium alone for sleep in adults, plus three on cramps or restless legs. Results were inconsistent and certainty low to very low; it does not support magnesium as routine insomnia treatment.
Pooled review (meta-analysis) · Mah 2021
Pooled three trials in 151 older adults with insomnia. People fell asleep 17.36 min sooner on magnesium; a 16.06 min gain in total sleep was not clear. Evidence quality was low to very low.
Systematic review · Arab 2023
Reviewed 9 studies with 7,582 people. Surveys and follow-up studies linked magnesium status to sleep quality, but trials gave contradictory results, so the link with supplements stayed uncertain.
How the research grew
The papers we read span 2010 to 2026. 9 of the 16 on-topic papers came out in 2024 to 2026. The earliest trial in people here is from 2010.
- 2010
- 2021
- 2022
- 2023
- 2024
- 2025
- 2026
Each dot is one on-topic paper, colored by what it found. Rings mark key papers:
- 2010. Earliest trial here: magnesium matched placebo. Nielsen 2010
- 2021. Pooled trials: faster sleep onset in older adults. Mah 2021
- 2024. Largest trial: 290 people with diabetes and insomnia. Khalid 2024
- 2026. Large cohort: no consistent link to sleep. Stadie 2026
- 2026. Biggest review: twelve trials, inconsistent results. Lopresti 2026
Doses tested
6 trial papers gave a set daily amount in mg a day, from 100 to 500. Each dot shows the dose and what the trial found.
- mg a day0100200300400500600
- Points to benefit
- Mixed
- No difference
- No direction
- Points to harm
One row per paper, so a trial reported in two papers appears twice.
Not shown: 1 trial paper with no single daily dose in the abstract, or a different unit.
Who funds this research
None of the 7 trial papers declares a company stake; 2 have no disclosure in PubMed. One population study lists GlaxoSmithKline among its funders. Company stakes did not change the confidence.
- No disclosure in PubMed 2
- No stake declared 5
- Saba 2022No disclosure in PubMed
- Nielsen 2010No disclosure in PubMed
- Khalid 2024No stake declared
- Barna 2021No stake declared
- Macian 2022No stake declared
- Walyddaini 2026No stake declared
- Jadidi 2022No stake declared
Funding rule. A stake is always shown. Confidence is lowered only when every supporting study comes from a party with a stake. "No disclosure in PubMed" means the PubMed record has no conflict-of-interest statement. It does not mean there is no conflict.
All 16 on-topic papers
Each paper shows what it tested, what it found, and who has a stake. Every paper also has its own page that explains how much it counts and how it fits. See every study as a list.
-
Randomized trial · measured the question itselfKhalid et al., 2024Frontiers in endocrinology · PubMed
Effects of magnesium and potassium supplementation on insomnia and sleep hormones in patients with diabetes mellitus.
290 people · adults with diabetes and insomnia (320 started, 290 finished)
TestedPlacebo, magnesium, potassium, or both as tablets for 2 months; one-blind
Insomnia scores after the trial differed between groups (p = 0.0001). Stress hormone (cortisol) and sleep hormone (melatonin) levels also changed in the supplement groups. Supplements cut insomnia severity.
Points to benefitNo stake declaredAbstract onlyNo competing interests declared.
-
Randomized trial · other health measuresWalyddaini et al., 2026East Asian archives of psychiatry · PubMed
Magnesium supplementation as an adjunct to fluoxetine therapy for depression.
40 people · adults aged 18 to 45 with depression taking fluoxetine
TestedFluoxetine plus 250 mg magnesium a day vs fluoxetine alone for 6 weeks
Depression score fell more with magnesium (-6.35 vs -2.80, p < 0.001), particularly in mood and insomnia parts. Main outcome was depression, not sleep.
Points to benefitNo stake declaredAbstract onlyNo competing interests declared.
-
Short-Term Magnesium Therapy Alleviates Moderate Stress in Patients with Fibromyalgia: A Randomized Double-Blind Clinical Trial.
adults with fibromyalgia (a long-term pain condition)
Tested100 mg magnesium chloride once a day vs placebo for 1 month
Main stress score did not differ between groups (21.8 ± 9.6 vs. 21.6 ± 10.8, p = 0.930). Pain fell more with magnesium (p = 0.029). Sleep did not differ clearly between groups.
No differenceNo stake declaredAbstract onlyNo competing interests declared.
-
Effect of short-term magnesium supplementation on anxiety, depression and sleep quality in patients after open-heart surgery.
60 people · 60 adults after open-heart surgery
Tested500 mg magnesium oxide a day for 5 days vs usual care only
Sleep score (lower is better) was 8.3 ± 2.1 with magnesium vs 10.3 ± 2.0 in usual care (p=0.001). Anxiety and depression were also lower (p=0.007).
Points to benefitNo disclosure in PubMedAbstract onlyNo disclosure in PubMed.
-
Randomized trial · other health measuresJadidi et al., 2022BMC complementary medicine and therapies · PubMed
Therapeutic effects of magnesium and vitamin B6 in alleviating the symptoms of restless legs syndrome: a randomized controlled clinical trial.
75 people · adults with restless legs syndrome for at least 3 months
Tested250 mg magnesium oxide a day, or 40 mg vitamin B6, vs placebo, for 2 months; one-blind
At month two, sleep quality and symptom severity differed between the three groups (P = 0.001). The authors said magnesium and vitamin B6 improved sleep quality and eased symptoms.
Points to benefitNo stake declaredAbstract onlyNo competing interests declared.
-
A randomized, double-blind, placebo-controlled, multicenter study assessing the efficacy of magnesium oxide monohydrate in the treatment of nocturnal leg cramps.
175 people · adults with night-time leg cramps (216 screened, 175 finished)
TestedOne 226 mg magnesium oxide capsule at bedtime vs placebo for 60 days
Leg cramp episodes fell more with magnesium than placebo (- 3.4 vs - 2.6; p = 0.01). Sleep quality improved more with magnesium than placebo (p < 0.001). Sleep was a secondary measure.
Points to benefitNo stake declaredAbstract onlyNo competing interests declared.
-
Magnesium supplementation improves indicators of low magnesium status and inflammatory stress in adults older than 51 years with poor quality sleep.
96 people · adults aged 51 to 85 with poor sleep (100 started, 96 finished)
Tested320 mg magnesium a day as citrate vs placebo for 7 weeks
Sleep scores improved from 10.4 to 6.6 (p < 0.0001) whether people got magnesium or placebo. The authors could not tell if magnesium helped sleep. Inflammation marker fell only in people with high starting levels.
No differenceNo disclosure in PubMedAbstract onlyNo disclosure in PubMed.
-
Population study: followed a groupChen et al., 2026The American journal of clinical nutrition · PubMed
Diabetes modifies the association between magnesium and insomnia, but not depressive symptomatology, in Puerto Rican adults: a prospective cohort study.
613 people · Puerto Rican adults in Boston followed for about 4 years
TestedWhether magnesium from food, supplements or blood predicts insomnia symptoms later
Magnesium was not linked to insomnia in the full group. In people without diabetes, supplement users had lower odds of insomnia than non-users (OR 0.37; 95% CI 0.17, 0.81). People with diabetes showed no link. Blood magnesium was not linked.
MixedNo stake declaredAbstract onlyNo competing interests declared.
-
Magnesium supplements, sleep quality, and nocturnal leg cramps: a combination of cross-sectional and prospective studies.
3,887 people · adults from a Swiss community group, about 57 years old, 4.5% taking magnesium
TestedCompared people who take magnesium supplements with non-users on sleep questionnaires, sleep lab tests and night cramps, over three check-ups
No consistent link between magnesium supplements and sleep scores or sleep lab results. Users had more night cramps or restless legs, with a trend toward poorer sleep. Magnesium did not prevent night cramps.
No differenceCompany stakeAbstract onlyThe cohort lists GlaxoSmithKline among its funders; authors report no competing interest.
-
Association between magnesium deficiency score and sleep quality in adults: A population-based cross-sectional study.
20,585 people · US adults aged 20 and older from a national health survey
TestedA score of how likely the body is low in magnesium, compared with sleep problems
A higher magnesium depletion score went with more sleep trouble and sleep disorder, and with sleep apnea (OR = 3.01; 95 % CI 1.37-6.62). No link with restless legs, insomnia or insufficient sleep.
MixedNo stake declaredAbstract onlyNo competing interests declared.
-
Causal relations of trace elements and nutrients with insomnia: A Mendelian randomization study.
large genetic databases (FinnGen) on blood nutrient levels and insomnia
TestedWhether genes that raise blood magnesium (and other nutrients) also change insomnia risk
Genetically higher blood magnesium was linked to lower insomnia risk (OR = 0.869, 95% CI = 0.763-0.990, P < .05). No other nutrient showed a link.
Points to benefitNo stake declaredAbstract onlyNo competing interests declared.
-
Genetically Supported Causality Between Micronutrients and Sleep Behaviors: A Two-Sample Mendelian Randomization Study.
large genetic databases on 15 blood micronutrients and sleep habits
TestedWhether genes that change blood levels of magnesium and 14 other nutrients change sleep length, insomnia or body clock type
No causal link was found between micronutrient levels and sleep duration or insomnia. Only folate, vitamin B6 and vitamin D related to chronotype (morning or evening type). Magnesium is not named in the results.
No differenceNo stake declaredAbstract onlyNo competing interests declared.
-
Serum magnesium levels and their association with sleep quality and disease severity in fibromyalgia syndrome: An observational cross-sectional study.
82 people · 82 adults with fibromyalgia (a long-term pain condition)
TestedCompared blood magnesium in people with poor sleep (PSQI > 5, 55 people) and good sleep (27 people)
The poor-sleep group had lower blood magnesium (P = .038). Magnesium and sleep scores were negatively correlated (ρ = -0.324, P = .003). Cause cannot be shown.
Points to benefitNo stake declaredAbstract onlyNo competing interests declared.
-
Magnesium Supplementation for Sleep in Adults: A Systematic Review of Randomized Controlled Trials.
12 studies · adults in 12 trials on sleep, insomnia or poor sleep (3 more on cramps or restless legs)
TestedMagnesium by mouth alone vs comparison groups, with many doses and lengths
Findings were inconsistent across sleep diaries, brain recordings, wrist trackers and body markers. Magnesium may give modest benefit on some self-reported measures; evidence was low to very low certainty and does not support routine use for insomnia.
MixedNo disclosure in PubMedAbstract onlyNo disclosure in PubMed.
-
The Role of Magnesium in Sleep Health: a Systematic Review of Available Literature.
9 studies, 7,582 people · adults in 9 studies (surveys, long-term follow-ups and trials)
TestedHigher magnesium intake or supplements vs lower intake or placebo, looking at sleep
Survey and follow-up studies linked magnesium status to sleep quality (daytime falling asleep, sleepiness, snoring, sleep duration). The trials gave contradictory findings on supplements; the link was called uncertain.
MixedNo disclosure in PubMedAbstract onlyNo disclosure in PubMed.
-
Oral magnesium supplementation for insomnia in older adults: a Systematic Review & Meta-Analysis.
3 studies, 151 people · older adults with insomnia
TestedMagnesium by mouth (under 1 g, up to three times a day) vs placebo or no treatment
Time to fall asleep was 17.36 min less with magnesium than placebo (95% CI - 27.27 to - 7.44). Total sleep time rose 16.06 min, not statistically clear. All trials had moderate-to-high bias; evidence low to very low quality.
MixedNo stake declaredAbstract onlyNo competing interests declared.
26 papers we read and set aside as off topic
- Chan et al., 2022. Efficacy of dietary supplements on improving sleep quality: a systematic review and meta-analysis. (pooled review (meta-analysis))
- Phupong et al., 2015. Interventions for heartburn in pregnancy. (pooled review (meta-analysis))
- González-Parejo et al., 2024. Effects of Dietary Supplementation in Patients with Restless Legs Syndrome: A Systematic Review. (systematic review)
- Liu et al., 2021. Effect of oral magnesium supplementation for relieving leg cramps during pregnancy: A meta-analysis of randomized controlled trials. (pooled review (meta-analysis))
- Ferreira et al., 2019. Magnesium and malic acid supplement for fibromyalgia. (pooled review (meta-analysis))
- Zhang et al., 2022. Effects of magnesium valproate adjuvant therapy on patients with dementia: A systematic review and meta-analysis. (pooled review (meta-analysis))
- Nardecchia et al., 2026. Follow-up and outcome of patients with primary BH4 deficiencies. (systematic review)
- Langan-Evans et al., 2023. Nutritional Modulation of Sleep Latency, Duration, and Efficiency: A Randomized, Repeated-Measures, Double-Blind Deception Study. (randomized trial)
- Noah et al., 2022. Effect of a Combination of Magnesium, B Vitamins, Rhodiola, and Green Tea (L-Theanine) on Chronically Stressed Healthy Individuals-A Randomized, Placebo-Controlled Study. (randomized trial)
- Liu et al., 2016. Efficacy and Safety of MMFS-01, a Synapse Density Enhancer, for Treating Cognitive Impairment in Older Adults: A Randomized, Double-Blind, Placebo-Controlled Trial. (randomized trial)
- Carlos et al., 2024. The effects of melatonin and magnesium in a novel supplement delivery system on sleep scores, body composition and metabolism in otherwise healthy individuals with sleep disturbances. (randomized trial)
- Di Giacomo et al., 2024. The role of nutraceuticals in the management of temporomandibular disorders. (randomized trial)
- Ibarra et al., 2014. The Mediterranean diet and micronutrient levels in depressive patients. (randomized trial)
- Scholey et al., 2017. Exploring the Effect of Lactium™ and Zizyphus Complex on Sleep Quality: A Double-Blind, Randomized Placebo-Controlled Trial. (randomized trial)
- Macfadden et al., 2024. Effectiveness and optimization of low-sodium oxybate in participants with narcolepsy switching from a high-sodium oxybate: data from the Substitution of Equal Grams of Uninterrupted Xyrem to Xywav study. (trial, not randomized)
- Fathy et al., 2024. Effect of intra-operative Magnesium sulphate on the occurrence of post-operative delirium and insomnia in patients undergoing lumbar fixation: a randomized controlled trial. (randomized trial)
- Singh et al., 2004. Mechanisms of acute myocardial infarction study (MAMIS). (population study: cases vs controls)
- Mukhopadhyay et al., 2025. The direct and urinary electrolyte-mediated effects of ambient temperature on population blood pressure: A causal mediation analysis. (other)
- Tramer et al., 1996. Role of magnesium sulfate in postoperative analgesia. (randomized trial)
- Dodd et al., 2025. Effects of a Scutellaria baicalensis/Crataegus laevigata, magnesium and chromium supplement on stressed individuals: A randomised, double-blind, placebo-controlled, crossover trial. (randomized trial)
- Saadawy et al., 2010. Lidocaine vs. magnesium: effect on analgesia after a laparoscopic cholecystectomy. (randomized trial)
- Soon et al., 2025. Mulberry leaf extract combined with tryptophan improves sleep and post wake mood in adults with sleep complaints - A randomized cross-over study. (randomized trial)
- Zielińska et al., 2023. Dietary Nutrient Deficiencies and Risk of Depression (Review Article 2018-2023). (opinion or narrative review)
- Guerrero-Romero et al., 2023. Hypomagnesemia and 25-hydroxyvitamin D deficiency in patients with long COVID. (population study: one-time survey)
- Hannigan et al., 2024. Effects of nonprescription therapies on vestibular migraine: a questionnaire-based observational study. (population study: followed a group)
- Fushimi et al., 2025. Relationship Between Insoluble Dietary Fiber Intake and Non-Restorative Sleep in Japanese Adults: A Cross-Sectional Analysis of the NHNS Japan, 2014 and 2018. (population study: one-time survey)
Words on this page
- Odds ratio (OR)
- Another way to compare two groups. 1 means no difference. Below 1 means lower odds, above 1 higher odds.
- 95% CI (confidence interval)
- The range where the true result likely lies. If the range includes no effect (1 for ratios, 0 for differences), the result is not clear.
- p-value (p =)
- How likely a result this large would be by chance if there were no real effect. Below 0.05 is usually called a clear result.
- Placebo
- A dummy pill or fake treatment, so people do not know which group they are in.
- Pooled review (meta-analysis)
- A study that combines the results of many earlier studies to get one overall answer.
- Gene study (Mendelian randomization)
- A study that uses natural gene differences between people as a kind of experiment.
- Marker
- A lab or scan result that stands in for a health outcome. A better marker does not always mean better health.
How the short answer is set
Fixed rules turn the studies into the short answer, so the same studies always give the same answer. The rules start from GRADE, a standard system for rating evidence, in plain language.
| Confidence | What it means |
|---|---|
| High | We are confident the answer is right. |
| Moderate | The answer is probably right, but it could change. |
| Low | The answer may well change. |
| Very low (this page) | Any answer is very uncertain. |
| Not tested in people | Only cell or animal studies exist. |
Why very low here
- Trials are small, and the pooled trials had moderate-to-high risk of bias.
- Results disagree: some trials show faster sleep onset, others no gain over placebo.
- Only 151 people were pooled; the total sleep time range includes no effect.
- Many trials studied other illnesses, with sleep only a side measure.
How this page was made
Label
- Search
- PubMed, Nov 14, 2026. Searches written by Claude Opus 5.5; papers ranked by PubMed
- First read of all 42 papers
- Claude Sonnet
- Independent second read
- Claude Haiku
- Disagreements settled by
- Claude Opus 5.5
- Page text written by
- Claude Opus 5.5
- Charts
- Drawn by code from the study records
- Source check by a person
- Not yet. Required before search engines may list this page.
- Expert review
- No
- Papers read in full
- 0 of 42; all from PubMed abstracts
- Method
- v0.2, created Nov 14, 2026
Search. We ran four PubMed searches for magnesium supplements and sleep quality and insomnia: pooled and systematic reviews since 2012 (10 of 14), trials in people (22 of 66), population studies (10 of 58). The first number is how many papers we read; the second is how many PubMed found. We took the ones PubMed ranks as most relevant. See the full PubMed search. Of the 42 papers read, 16 were on topic.
Limits. Digestery reads at most about 60 papers per question, so large fields are sampled, not covered in full. Abstracts can leave out key details, such as side effects and funding.
Review queue
These items wait for a person. Search engines are asked not to list the page until the first one is done.
- OpenThe short answer is new. It waits for a source check by a person.
- OpenIV magnesium sulfate surgery trials (Tramer 1996, Saadawy 2010, Fathy 2024) marked off-topic as not supplements; read B called them relevant. Confirm.
- OpenBlends with magnesium (Langan-Evans 2023, Scholey 2017, Noah 2022, Carlos 2024, Soon 2025) marked off-topic because magnesium's own effect cannot be separated. Confirm.
- OpenGonzález-Parejo 2024, a restless legs supplement review, marked off-topic; its magnesium oxide finding likely overlaps trial Jadidi 2022.
- OpenWalyddaini 2026 kept relevant only for insomnia items inside a depression scale; no sleep-specific numbers in the abstract. Confirm.
- OpenLuo 2024 uses a kidney-based magnesium depletion score, not intake or blood level; confirm it counts as a close form.
- OpenMah 2021 and Lopresti 2026 likely pool some of the same trials, possibly Nielsen 2010; check overlap before counting them as separate evidence.
- OpenMacian 2022 tests a branded product (Chronomag); PubMed record shows no funding source.
- OpenKhalid 2024 abstract does not report the magnesium-only arm separately or the dose; Saba 2022 may not be randomized.
Page history
| Date | Change | Reason |
|---|---|---|
| Nov 14, 2026 | Page created from 42 papers. | First version of the page. |
Flag an error
A flag must point to a source: the passage in the paper, or a link to a study this page missed. A flag starts a new check. Votes never change a page.