Melatonin vs magnesium for sleep comes down to what each one does. Melatonin is the hormone your body makes in the evening to signal night, and in pooled trials it helped people fall asleep about 7 minutes sooner and sleep about 8 minutes longer. Magnesium is a mineral, and its sleep trials are small and mixed: the clearest results were in older adults and people who get little magnesium from food. No trial has compared the two head to head.
Below you'll find how the two compare, what the human studies found for each, the doses studied, side effects, taking them together, and what to know about children. Our own grading of the studies agrees with the trials: on our sleep goal page, melatonin is one of the ingredients with evidence (58 human studies read, including six pooled analyses), while magnesium shows no clear effect across 53.
Melatonin vs Magnesium for Sleep: Side by Side
This table sets out what the human studies found for each.
| Melatonin | Magnesium | |
|---|---|---|
| What it is | A hormone your brain releases in the evening that tells your body it is night | A mineral used in hundreds of processes, including nerve and muscle relaxation |
| Falling asleep | About 7 minutes sooner than placebo across 19 trials | About 17 minutes sooner in 3 small trials of older adults, from low-quality evidence |
| Sleep length | About 8 minutes longer across 19 trials | Not shown in the larger trials |
| Jet lag | Eased jet lag in 9 of 10 trials | Not studied |
| Dose in the trials | 0.3 mg to 5 mg, 30 to 60 minutes before bed | 250 mg to 500 mg of magnesium a day |
| Our grade for sleep | Improvement (58 human studies) | No clear effect (53 human studies) |
| Main caution | Labels are often wrong about how much is inside | Loose stools at higher doses; upper limit 350 mg a day from supplements |
Not sure which fits you? Get a protocol that picks for you.
Melatonin: What the Studies Show for Sleep
Your body starts releasing melatonin a couple of hours before your usual bedtime, and the level falls again by morning. A supplement adds to that evening signal. That is why melatonin works more like a clock-setter than a sedative.
Pooling 19 trials of 1,683 adults and children with ongoing sleep problems, melatonin shortened the time it took to fall asleep by about 7 minutes and added about 8 minutes of sleep compared with placebo. Overall sleep quality also improved. The authors called the effects modest, and they did not fade with continued use (Ferracioli-Oda 2013).
A later review of 22 trials with 4,875 adults found that slow-release melatonin cut the time to fall asleep by about 5 to 6 minutes. It also raised sleep efficiency, the share of time in bed spent asleep, by about 2 points, with the largest gain in people over 55 (Maruani 2023). Across 23 trials of adults with a range of health problems, melatonin improved scores on a standard sleep-quality questionnaire (Fatemeh 2022).
Jet lag. Melatonin has its strongest record here. In 9 of 10 trials of travelers, melatonin taken close to the target bedtime at the destination eased jet lag after flights across five or more time zones. Doses from 0.5 mg to 5 mg worked about equally well, though people fell asleep faster on 5 mg, and more than 5 mg did no better (Herxheimer 2002).
Less can be enough. In adults over 50 who slept poorly, 0.3 mg taken 30 minutes before bed restored sleep efficiency, mostly in the middle of the night. A 3 mg dose also helped, but kept blood melatonin high into the morning and lowered body temperature (Zhdanova 2001).
Our melatonin page lists the human studies we graded and the melatonin products we rank.
Magnesium: What the Studies Show for Sleep
Magnesium helps nerves and muscles relax, and low magnesium has been linked with poorer sleep. Whether a supplement improves sleep is less clear.
Pooling three small trials in 151 older adults, people taking magnesium fell asleep about 17 minutes sooner than on placebo, but the authors rated the evidence low to very low in quality (Mah 2021). In one of those trials, 46 older adults who took 500 mg of magnesium a day for eight weeks had better sleep scores and sleep efficiency than on placebo (Abbasi 2012).
The larger trials found smaller effects or none. In 155 adults who slept poorly, 250 mg of magnesium a day as bisglycinate for four weeks lowered sleep-problem scores by 3.9 points against 2.3 on placebo, a small difference. People who got little magnesium from food seemed to gain the most (Schuster 2025). In 100 adults over 51 who slept poorly, 320 mg a day as citrate for seven weeks did no better than placebo (Nielsen 2010).
Glycinate is the form most often sold for sleep and the one with the trial above. Our magnesium glycinate vs citrate guide compares the forms, and our magnesium page and magnesium glycinate page list every study we graded.
Which One Has More Evidence for Sleep?
Melatonin has more evidence and larger trials. It may help you fall asleep a little sooner and sleep a little longer, especially when your body clock is out of step, as with jet lag or a late bedtime. The gains are measured in minutes, not hours.
Magnesium has fewer and smaller trials, with mixed results. Its clearest results came in older adults and in people who get little magnesium from food, so it may matter more if your diet is low in it. Nuts, seeds, beans, leafy greens and whole grains are good sources.
Neither one replaces the basics: a steady bedtime and wake time, morning light, less caffeine later in the day and a dark, cool bedroom. Our sleep supplements guide covers the other ingredients studied.
Can You Take Melatonin and Magnesium Together?
One trial tested them together. In 43 care-home residents aged about 78 who slept poorly, a nightly mix of 5 mg melatonin, 225 mg magnesium and 11.25 mg zinc, taken an hour before bed for eight weeks, improved sleep-quality scores by 6.8 points more than placebo and lengthened total sleep (Rondanelli 2011). Because the three were given together, the trial can't say which one did the work.
If you take both, count the magnesium from every product in your stack, including multivitamins and electrolyte drinks, against the upper limit of 350 mg a day from supplements (Costello 2023).
Already taking a sleep supplement? Check your stack for doubling up and timing.
Doses Studied and When to Take Them
Melatonin: 0.3 mg to 5 mg in the trials, taken 30 to 60 minutes before bed. More than 5 mg did no better for jet lag. Taken early in the day, it can cause sleepiness and push your body clock the wrong way (Herxheimer 2002).
Magnesium: 250 mg to 500 mg of magnesium a day in the sleep trials, usually in the evening. The dose on a label is the magnesium itself; a 1,000 mg capsule of magnesium glycinate may hold only about 140 mg of magnesium.
Side Effects and Label Accuracy
Melatonin. Across 37 placebo-controlled trials, side effects were few and mostly mild: daytime sleepiness, headache, dizziness and feeling cold were the most often reported, and most passed within days. Few trials lasted longer than four weeks, so long-term safety is less well studied (Besag 2019).
The bigger problem is what is in the bottle. When 31 melatonin products were tested, the melatonin ranged from 83% less to 478% more than the label said, and more than 71% were not within 10% of the label (Erland 2017). Of 25 melatonin gummies tested in the US, 22 were wrongly labeled, holding 74% to 347% of the stated amount (Cohen 2023).
Magnesium. The most common side effect is loose stools, which become more likely as the dose rises (Costello 2023). People whose kidneys don't work fully can build up magnesium and should talk to their doctor first.
Melatonin vs Magnesium for Kids
Talk to your child's doctor before giving either. In seven trials of 387 children and teens who had trouble falling asleep, melatonin helped them fall asleep about 22 minutes sooner and sleep about 23 minutes longer, though the trials were of low to moderate quality (Wei 2020). Reports to US poison centers of children swallowing melatonin rose 530% from 2012 to 2021, mostly young children finding gummies (Lelak 2022). Keep any sleep supplement out of reach. We found no trials of magnesium for sleep in healthy children.
Your Sleep in the Daily Protocol
Every Daily Protocol has a Sleep box. Rala, the AI behind Reverse Age Lab, works from your own bedtime and wake time to suggest your evening routine: light, caffeine, your last meal and winding down. It places your evening supplements in your Before Bed block and checks them against everything else you take and your meds. Start your personalized protocol.
Check Against Your Meds
Melatonin can add to the effect of meds that make you sleepy, and case reports raise questions about some blood-thinning meds (Herxheimer 2002). Magnesium can reduce how well some meds are absorbed when taken at the same time, so spacing matters. Rala checks every product in your stack against your meds before it places anything in your protocol.
Is this medical advice? No. This guide sets out the published research on melatonin and magnesium for sleep; it is not a diagnosis, and Rala isn't a medical device or a clinician. Talk to your doctor before adding either, especially if you take meds, are pregnant, or if your kidneys don't work fully.
Frequently Asked Questions
Which is better for sleep, melatonin or magnesium?
Melatonin has more and larger trials: about 7 minutes faster to fall asleep and 8 minutes more sleep across 19 trials, and a strong record for jet lag. Magnesium's trials are small and mixed, with the clearest results in older adults and people low in magnesium. No trial has compared them directly.
Can I take melatonin and magnesium together?
One trial of 43 older adults gave melatonin, magnesium and zinc together and found better sleep than placebo, but it can't say which ingredient helped. If you combine them, keep magnesium from all supplements under 350 mg a day and check them against your meds.
Melatonin vs magnesium glycinate: which helps more?
Melatonin has the larger body of evidence. Magnesium glycinate's main sleep trial, in 155 adults, found a small benefit after four weeks, mostly in people who got little magnesium from food.
Which helps you stay asleep?
Melatonin raised sleep efficiency in pooled trials, and a 0.3 mg dose helped older adults most in the middle of the night. In one trial of older adults, magnesium also improved sleep efficiency. Both effects were small.
Is it safe to take melatonin every night?
In trials lasting up to a few months, side effects were few and mild, and the benefit did not fade with continued use. Long-term trials are scarce, so talk to your doctor about nightly use over months.
Sources
Ferracioli-Oda E, Qawasmi A, Bloch MH. Meta-analysis: melatonin for the treatment of primary sleep problems. PLoS One, 2013. PubMed.
Maruani J, Reynaud E, Chambe J et al. Efficacy of melatonin for the short- and long-term management of poor sleep in adults: a systematic review and meta-analysis. Journal of Sleep Research, 2023. PubMed.
Fatemeh G, Sajjad M, Niloufar R et al. Effect of melatonin supplementation on sleep quality: a systematic review and meta-analysis of randomized controlled trials. Journal of Neurology, 2022. PubMed.
Herxheimer A, Petrie KJ. Melatonin for the prevention and treatment of jet lag. Cochrane Database of Systematic Reviews, 2002. PubMed.
Zhdanova IV, Wurtman RJ, Regan MM et al. Melatonin treatment for age-related poor sleep. Journal of Clinical Endocrinology and Metabolism, 2001. PubMed.
Mah J, Pitre T. Oral magnesium supplementation for poor sleep in older adults: a systematic review and meta-analysis. BMC Complementary Medicine and Therapies, 2021. PubMed.
Abbasi B, Kimiagar M, Sadeghniiat K et al. The effect of magnesium supplementation on poor sleep in older adults: a double-blind placebo-controlled clinical trial. Journal of Research in Medical Sciences, 2012. PubMed.
Schuster J, Cycelskij I, Lopresti A et al. Magnesium bisglycinate supplementation in healthy adults reporting poor sleep: a randomized, placebo-controlled trial. Nature and Science of Sleep, 2025. PubMed.
Nielsen FH, Johnson LK, Zeng H. Magnesium supplementation improves indicators of low magnesium status and inflammatory stress in adults older than 51 years with poor quality sleep. Magnesium Research, 2010. PubMed.
Rondanelli M, Opizzi A, Monteferrario F et al. The effect of melatonin, magnesium, and zinc on poor sleep in long-term care facility residents in Italy: a double-blind, placebo-controlled clinical trial. Journal of the American Geriatrics Society, 2011. PubMed.
Costello R, Rosanoff A, Nielsen F et al. Perspective: call for re-evaluation of the tolerable upper intake level for magnesium supplementation in adults. Advances in Nutrition, 2023. PubMed.
Besag FMC, Vasey MJ, Lao KSJ et al. Adverse events associated with melatonin for poor sleep: a systematic review. CNS Drugs, 2019. PubMed.
Erland LA, Saxena PK. Melatonin natural health products and supplements: presence of serotonin and significant variability of melatonin content. Journal of Clinical Sleep Medicine, 2017. PubMed.
Cohen PA, Avula B, Wang YH et al. Quantity of melatonin and CBD in melatonin gummies sold in the US. JAMA, 2023. PubMed.
Wei S, Smits MG, Tang X et al. Efficacy and safety of melatonin for trouble falling asleep in children and adolescents: a meta-analysis of randomized controlled trials. Sleep Medicine, 2020. PubMed.
Lelak K, Vohra V, Neuman MI et al. Pediatric melatonin ingestions, United States, 2012-2021. Morbidity and Mortality Weekly Report, 2022. PubMed.





