Melatonin vs Magnesium for Sleep: Small Effects, Different Jobs
Melatonin is a timing signal with the larger evidence base; magnesium's best pooled evidence is three small trials in older adults. We found no trial testing them head to head, and both shave minutes, not hours, off falling asleep.
By Kymata Health Editorial Published Last checked
We earn a commission if you buy through links on this page. It never changes our grades or rankings. How we make money →
Quick pick
From a partner brand · paid linkBotanic Choice Melatonin 1 mg, 120 tablets
from Botanic Choice
Label: 1 tablet: 1 mg melatonin.
Best for trying one bottle: $7 one-time (checked Oct 19, 2026).
Key takeaways
From 9 sources- Across 19 trials in adults and children with primary sleep disorders, melatonin cut time to fall asleep by about 7 minutes and added about 8 minutes of sleep versus placebo1.
- Melatonin's effect grew with dose up to about 4 mg a day and appeared larger when taken earlier, about 3 hours before bedtime2.
- In 3 small trials in 151 older adults with insomnia, magnesium cut time to fall asleep by about 17 minutes, but the evidence was rated low to very low quality3.
- In delayed sleep-wake phase disorder, with both groups on a fixed bedtime, 0.5 mg of melatonin moved sleep onset 34 minutes earlier than placebo4.
- Melatonin products varied from 83% below to 478% above their labelled dose in one analysis of 31 supplements5.
What this article covers
2 evidence profilesThe evidence, graded
Pulled from the trial tables in our evidence profiles. Grades follow our evidence-grading policy.
Graded findings
3 rows- BGrade BTime to fall asleep, total sleep time and sleep qualityImproved Melatonin shortened sleep onset by about 7 minutes, increased total sleep by about 8 minutes and modestly improved sleep quality (SMD 0.22) versus placebo. Effects did not fade with continued use.Melatonin · Meta-analysis · n=1,683 · 2013 · PMID 23691095
- BGrade BSleep onset and total sleep by dose and timingImproved Melatonin gradually reduced sleep onset latency and increased total sleep time, peaking at 4 mg/day. Effects were larger in people with insomnia and when taken earlier before bedtime (about 3 hours) than the common 2 mg 30 minutes before.Melatonin · Meta-analysis · n=1,689 · 2024 · PMID 38888087
- CGrade CTime to fall asleep (older adults)Improved Sleep onset latency was 17.4 minutes shorter than placebo; total sleep time rose 16 minutes but not significantly. Trials were at moderate-to-high risk of bias; evidence quality low to very low.Magnesium · Meta-analysis · n=151 · 2021 · PMID 33865376
Where these trials agree: Melatonin and sleep, counted row by row in the Consensus finder.
Two different tools
Melatonin is a hormone the brain makes in response to darkness, and it helps set the timing of the body's 24-hour clock and sleep6. Magnesium is a mineral that acts as a cofactor in more than 300 enzyme systems, including ones involved in muscle and nerve function7.
That difference shapes what each one is studied for. Melatonin trials focus on falling asleep and on body-clock problems such as jet lag and delayed sleep timing6. The pooled magnesium sleep trials were in older adults with insomnia3.
Melatonin: consistent, but modest
A meta-analysis of 19 placebo-controlled trials with 1,683 people found melatonin shortened time to fall asleep by 7.06 minutes, increased total sleep by 8.25 minutes and modestly improved sleep quality1. The effects did not fade with continued use1.
A 2024 dose-response analysis of 26 trials found benefits rose with dose up to about 4 mg a day, and were larger in people with insomnia and when melatonin was taken about 3 hours before the desired bedtime rather than the common 30 minutes2. See how much melatonin to take and when for the details.
Melatonin does best when the problem is timing. In 116 people with delayed sleep-wake phase disorder and a late melatonin rhythm, all on a scheduled bedtime, 0.5 mg taken 1 hour before a set bedtime moved sleep onset 34 minutes earlier than placebo4. For chronic insomnia, the American Academy of Sleep Medicine issued a weak recommendation against using melatonin8.
Magnesium: thin evidence, mostly in older adults
A 2021 meta-analysis found only 3 randomized trials of oral magnesium for insomnia, with 151 older adults in three countries3. Time to fall asleep was 17.36 minutes shorter than placebo, and total sleep rose 16 minutes, which was not statistically significant3. All three trials were at moderate to high risk of bias3.
One of those trials gave 46 older adults 500 mg of magnesium a day for 8 weeks and found better insomnia severity scores, sleep efficiency and time to fall asleep than placebo9. That dose is above the 350 mg a day upper limit for magnesium from supplements, so it is not a dose to copy without a clinician's input79. For more, see what the magnesium sleep trials show.
No trial we found has compared melatonin and magnesium directly, so any claim that one beats the other is a comparison across different studies and populations13.
Safety and label problems
Short-term melatonin use appears safe for most people, but data on long-term use are lacking6. Reported side effects were mild, such as headache, dizziness, nausea and sleepiness, and melatonin may stay active longer in older people and cause daytime drowsiness6. People with epilepsy or taking blood thinners should use it only under medical supervision6.
Label accuracy is a real issue. In an analysis of 31 melatonin supplements, content ranged from 83% below to 478% above the label, and 26% contained serotonin5.
High doses of magnesium from supplements can cause diarrhoea, nausea and cramping, and the risk of magnesium toxicity rises with poor kidney function7. Magnesium can bind some antibiotics, which should be taken at least 2 hours before or 4 to 6 hours after it, and can reduce absorption of oral bisphosphonates7.
Which one fits you
- Body clock out of sync, such as jet lag or a late sleep schedule: melatonin has the timing evidence46.
- Older adult with trouble falling asleep: magnesium has a small, low-quality signal in this group3.
- Chronic insomnia: the American College of Physicians recommends cognitive behavioural therapy for insomnia as the initial treatment, ahead of any supplement6.
- Kidney disease, epilepsy, blood thinners, antibiotics or osteoporosis drugs: ask your clinician first, because of the interactions above67.
Quick answers
Common questions
3 answersCan I take melatonin and magnesium together?
Which works faster for falling asleep?
Keep reading
Full evidence profiles
Every graded study, studied doses, interactions and safetyRelated articles
4 articles- ArticleHow Much Melatonin Should You Take? Trials Used 0.5 to 5 mg, and Timing Mattered as Much as DoseHow much melatonin should you take, and when?
- ArticleMelatonin Gummies: 22 of 25 Were Mislabeled, and Child Poison-Center Calls Rose SixfoldAre melatonin gummies safe and accurately labeled?
- ArticleAshwagandha Interactions: Thyroid Medicine, Sedatives, SSRIs, Alcohol, Magnesium and L-TheanineWhat does ashwagandha interact with?
- ArticleBest Magnesium Supplement 2026: Ranked by Form, Label Dose vs Studied Dose, Testing and Cost per 100 mgWhat is the best magnesium supplement?
More on Supplements and vitamins
7 pages- TopicSupplements and vitamins: every page
- NextMethylcobalamin vs Cyanocobalamin: Is the “Active” B12 Worth Paying More For?Premium B12 bottles say methylcobalamin and warn about the "cyanide" in cyanocobalamin.
- In this topicMethylene Blue for Brain Fog: One Small Scan Study, a Failed Dementia Trial and a Serious Drug InteractionWellness influencers sell methylene blue as a mitochondrial booster for focus and energy.
- In this topicMethylfolate vs Folic Acid: What the MTHFR Gene Hype Gets WrongIf you have heard you "can’t process folic acid," you are not alone.
- In this topicMK-7 vs MK-4: The Two Kinds of Vitamin K2, and Why Their Doses Differ a ThousandfoldOne K2 label says 100 mcg, another says 45 mg.
- ToolEvidence-graded supplement stacks
- TopicsBrowse all topics
Browse the full Supplement & Nutrient Encyclopedia or all supplement articles.
Where to buy Melatonin
Products from brands we partner with that contain Melatonin. Check the amount per serving against the doses studied, and the label for other ingredients.
Melatonin products from partner brands
7 products Paid links · we earn a commission- Quick pickBotanic ChoiceBotanic Choice Melatonin 1 mg, 120 tablets
1 tablet: 1 mg melatonin; 120 tablets; label directions 1 tablet daily before bedtime; label: adults only, may cause drowsiness
$7.00one-timeChecked Oct 19, 2026 - SupersmartMelatonin Supplement (1 mg tablets)5% off with the Supersmart newsletterGet 5% off with the newsletter (paid link, opens in new tab)
Offer details
Sign up for the newsletter at the bottom of us.supersmart.com; Supersmart says the 5% discount is permanent.
- Supersmart’s footer offer reads “Subscribe to our newsletter and obtain a 5% permanent discount.”
- Supersmart says Subscribe & Save discounts can’t be combined with the 5% newsletter discount.
- 20% applies when 3 or more products ship on auto-delivery to the same address.
- Only products that show the Subscribe & Save offer qualify, and a Supersmart account is required.
- The newsletter discount and Subscribe & Save are separate offers; we don’t claim they combine.
- Offer terms from Supersmart’s site, checked Oct 16, 2026. Offers can change; the brand's checkout is final.
1 to 2 tablets: 1 mg melatonin per tablet; 120 tablets
$14.00one-time$11.90subscribeChecked Oct 11, 2026 - GoliGoli Dreamy Sleep Gummies, 60 gummies
1 gummy: 2.5 mg melatonin, 25 mg magnesium (as citrate), 45 mg lemon balm extract, 20 mg herbal blend (tart cherry, chamomile, passion flower) and 2.5 mcg vitamin D; label suggests 2 gummies at bedtime (5 mg melatonin)
$15.98one-timeChecked Oct 15, 2026 - Renue by ScienceRenue by Science LIPO Melatonin, liposomal capsules (90)Subscribe & Save 10%
Offer details
Choose the Subscribe & Save option on the product page.
- 10% off subscription orders on the products we list (prices on each card).
- Offer terms from Renue by Science’s site, checked Oct 15, 2026. Offers can change; the brand's checkout is final.
1 capsule: 1 mg melatonin; 90 servings
$29.95one-time$26.96subscribeChecked Oct 15, 2026 - Botanic ChoiceBotanic Choice Melatonin 3 mg Dual Release, 60 vege capsules
1 vege capsule: 3 mg melatonin (1.5 mg plus 1.5 mg in time-release beadlets); 60 capsules; label directions 1 capsule daily before bedtime; label: adults only, may cause drowsiness
$9.00one-timeChecked Oct 19, 2026 - HerbsProNatrol Melatonin Fast Dissolve, Strawberry, 1 mg, 90 Tabs
1 tablet: 1 mg melatonin, dissolved in the mouth; 90 tablets; label directions 1 tablet 20 minutes before bedtime; contains soy polysaccharides and xylitol
$7.60one-timeChecked Oct 19, 2026 - HerbsProNOW Foods Liquid Melatonin, 3 mg, 2 oz
0.9 mL (about 20 drops): 3 mg melatonin; label: adults only, at bedtime; contains alcohol (6%) and xylitol, which is harmful to pets
$5.57one-timeChecked Oct 19, 2026
References
9 sources. Numbers in the text link here.
Sources cited in this article
9 sources- 1Meta-analysis: melatonin for the treatment of primary sleep disordersPLoS One, 2013 · PMID 23691095
- 2Optimizing the Time and Dose of Melatonin as a Sleep-Promoting Drug: A Systematic Review of Randomized Controlled Trials and Dose-Response Meta-AnalysisJ Pineal Res, 2024 · PMID 38888087
- 3Oral magnesium supplementation for insomnia in older adults: a Systematic Review & Meta-AnalysisBMC Complement Med Ther, 2021 · PMID 33865376
- 4Efficacy of melatonin with behavioural sleep-wake scheduling for delayed sleep-wake phase disorder: A double-blind, randomised clinical trialPLoS Med, 2018 · PMID 29912983
- 5Melatonin Natural Health Products and Supplements: Presence of Serotonin and Significant Variability of Melatonin ContentJ Clin Sleep Med, 2017 · PMID 27855744
- 6Melatonin: What You Need To KnowNational Center for Complementary and Integrative Health (NIH), 2024
- 7Magnesium: Fact Sheet for Health ProfessionalsNIH Office of Dietary Supplements, 2026
- 8Clinical Practice Guideline for the Pharmacologic Treatment of Chronic Insomnia in Adults: An American Academy of Sleep Medicine Clinical Practice GuidelineJ Clin Sleep Med, 2017 · PMID 27998379
- 9The effect of magnesium supplementation on primary insomnia in elderly: A double-blind placebo-controlled clinical trialJ Res Med Sci, 2012 · PMID 23853635
Melatonin and other dietary supplements are not intended to diagnose, treat, cure or prevent any disease, and these statements have not been evaluated by the FDA. Talk to your clinician or pharmacist before starting a supplement, especially if you take prescription medicines. Product links on this page are paid partner links.



