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.

Quick pick

Botanic 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).

How we chose: Momentous is the partner brand we list first, so its product leads whenever the Where to buy list has one for this compound or a form in our Forms table. Otherwise, among partner brands that passed our vetting without conditions (others only when none sells it), the first product in that list whose name matches a form in our Forms table, else the first one listed. Not a claim that it works: check the amount per serving against the studied doses and limits on our Melatonin page.

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 profiles

The evidence, graded

Pulled from the trial tables in our evidence profiles. Grades follow our evidence-grading policy.

Graded findings

3 rows
  1. Grade 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
  2. Grade 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
  3. Grade 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

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

For the full evidence tables, see the melatonin and magnesium pages.

Match the supplement to the sleep problem, and keep expectations to minutes:

  • 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 answers
Can I take melatonin and magnesium together?

No trial in this article tested the combination. Each has its own cautions: melatonin with epilepsy or blood thinners6, and magnesium above 350 mg a day from supplements or with kidney problems7.

Which works faster for falling asleep?

Melatonin cut time to fall asleep by about 7 minutes across 19 trials1; magnesium by about 17 minutes in 3 low-quality trials in older adults3. The populations differ, so the numbers are not directly comparable13.

Does melatonin stop working over time?

Its effects did not fade with continued use in a meta-analysis of 19 trials1, but long-term safety data are limited6.

Keep reading

Full evidence profiles

Every graded study, studied doses, interactions and safety

Related articles

4 articles

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
  • 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

Listing a product is not a claim that it works; check the amount per serving against the doses studied, and the label for other ingredients.Prices and labels are from each brand’s own site on the date shown; confirm before you buy.

Partner links may earn us a commission. How partner links work

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.

Educational only. Not medical advice. Some links earn us a commission: kymatahealth.com/affiliate-disclosure.