The Melatonin GuideTake it on your own clock
A magnesium capsule
Is it safe

Should I take melatonin or magnesium for sleep?

By GyroscopeUpdated November 14, 20265 sources
On this page
  1. Side by side
  2. The magnesium trial
  3. What melatonin does
  4. Before either one

They do different jobs. Melatonin tells your body clock it’s evening, so the hour you take it changes what it does. Magnesium helped a little in a 2025 trial, where 155 adults with poor sleep took 250 mg a day or a placebo for 4 weeks, and their insomnia score dropped 3.9 points against 2.3, a small effect.

The two sit on the same shelf and get recommended in the same breath, so people treat them as rivals for the same job. Melatonin is about when you sleep, and magnesium, in the 2025 trial, nudged how bad people rated their insomnia.

We’d fix the hour and the light before adding either. If you want to try one, pick the one that fits your problem, take only that one for two weeks, and check your own nights. Taking both at once makes it impossible to tell which did anything.

Comparing them is like comparing a watch with a pillow. One tells your body what time it is, and the other might make the night a little more comfortable.

Side by side

MelatoninMagnesium
What it doesTells your body clock it’s evening, and nudges sleepinessSmall drop in insomnia symptoms in one 2025 trial
Best forFalling asleep sooner, moving a late schedule, jet lagPeople who eat little magnesium and sleep poorly
Dose studied0.5 to 1 mg to start, 5 mg the top250 mg of elemental magnesium as bisglycinate
When1 to 3 hours before bed, or about 5 hours before your usual bedtime to move earlierOnce a day in the trial
Size of the effectAbout 7 minutes faster to fall asleep on average3.9 points against 2.3 on an insomnia score, a small effect

The magnesium trial

In 2025, researchers in Hannover, Germany, randomly gave 155 adults aged 18 to 65 who said they slept poorly either magnesium bisglycinate, 250 mg of elemental magnesium a day, or a placebo. After 4 weeks, insomnia scores fell 3.9 points with magnesium and 2.3 with the placebo. The difference was small, and the authors called it a modest benefit. People who ate little magnesium seemed to gain more. Nothing else they measured changed, and sleep was self-reported, with no tracker or lab.

What melatonin does

Melatonin’s effect on falling asleep is small too, about 7 minutes faster on average across 19 trials, and it grows when it’s taken earlier, about 3 hours before bed in a 2024 analysis of 26 trials. Its bigger job is the clock. In a 2010 lab study, 0.5 mg taken in the afternoon moved people’s body clocks earlier, as far as 3 mg did. Magnesium has no timing job like that.

Before either one

Light reaches your body clock without any pill. In a 2011 study, ordinary room light before bed made melatonin start later in 99 percent of 116 young adults. Lamps instead of overhead lights, and a fixed wake time, are free.

If you take a prescription medicine every day, ask your prescriber before adding melatonin, magnesium or anything else. Don’t drive after a dose.

Does it work for you?

I'll watch
I take it
1234567891011121314
Lilac nights on, grey off, hollow ones dropped for drinks or a late night. The band is your normal swing around your off-night median.
Inside your normal swing

5.5 minutes to fall asleep faster on melatonin (median 19.5 against 25), with a normal swing of about 7.7. 1 night dropped.

The difference is smaller than your nights already vary. It may be doing a little, or nothing you can see. Try it at the right hour before you decide.

Night 1min
Night 2min
Night 3min
Night 4min
Night 5min
Night 6min
Night 7min
Night 8min
Night 9min
Night 10min
Night 11min
Night 12min
Night 13min
Night 14min

Pick the outcome before you start, and don't change it halfway. The verdict rule is ours: a difference bigger than the standard deviation of your off nights counts as real for you.

5 sources
  1. Schuster J and others, Magnesium bisglycinate supplementation in healthy adults reporting poor sleep: a randomized, placebo-controlled trial, Nature and Science of Sleep, 2025pubmed.ncbi.nlm.nih.gov
  2. Burgess HJ, Revell VL, Molina TA, Eastman CI, Human phase response curves to three days of daily melatonin: 0.5 mg versus 3.0 mg, Journal of Clinical Endocrinology and Metabolism, 2010pubmed.ncbi.nlm.nih.gov
  3. Ferracioli-Oda E, Qawasmi A, Bloch MH, Meta-analysis: melatonin for the treatment of primary sleep disorders, PLoS One, 2013pubmed.ncbi.nlm.nih.gov
  4. Cruz-Sanabria F and others, Optimizing the time and dose of melatonin as a sleep-promoting drug: a systematic review of randomized controlled trials and dose-response meta-analysis, Journal of Pineal Research, 2024pubmed.ncbi.nlm.nih.gov
  5. Gooley JJ and others, Exposure to room light before bedtime suppresses melatonin onset and shortens melatonin duration in humans, Journal of Clinical Endocrinology and Metabolism, 2011pubmed.ncbi.nlm.nih.gov
With Gyroscope One, snap the bottle when you take it and see your melatonin nights against your usual sleep, from your Apple Watch, Oura, WHOOP or Garmin. Open Gyroscope

Your personalized guide

When should I take melatonin, and how much?

Eight taps. You get when your own melatonin probably starts, the hour and the dose for what you want it to do, and a way to tell in two weeks if it's working.

  • Your window, on your own clock
  • Your dose against the trials
  • Free, under a minute
Start