Magnesium vs Melatonin: Which One Actually Helps You Stay Asleep?
These are the two supplements people ask me about most, usually as a straight either-or question. The honest answer is that they're not really competing for the same job, and understanding that difference matters more than picking a winner.
What does each one actually do?
Melatonin is a hormone tied to your body's internal clock. As a supplement, its most consistent evidence is for sleep onset, falling asleep faster, and for shifting circadian timing, which is why it's genuinely useful for jet lag. A government health technology review summarizing the trial evidence found effects on sleep maintenance were mixed and inconsistent across studies (CADTH Health Technology Review, 2022). Full detail on dosing and timing is in the melatonin article.
Magnesium works differently, as a mineral involved in nervous system regulation generally, not a circadian signal. A 2025 randomized trial found magnesium bisglycinate modestly reduced insomnia severity compared to placebo over the study period. The effect was real but small, and the specific form used mattered, since not all magnesium compounds absorb the same way. Full detail is in the magnesium article.
Which has better evidence for staying asleep specifically?
Magnesium, by a narrow margin, if staying asleep is genuinely your problem rather than falling asleep in the first place. That's a real distinction worth sitting with. Melatonin's evidence is more consistent for the front end of the night. Neither one has the kind of strong, repeated trial evidence that would let me say it reliably fixes a 3am waking. Both are modest tools, not solutions, and I'd rather tell you that plainly than oversell either one.
Can you take them together?
There's no strong evidence against it. They work through different mechanisms, so combining them isn't redundant the way taking two melatonin products would be. Some people take magnesium in the evening generally and melatonin closer to bedtime specifically, timed to its own purpose. I'd still rather you go in with modest expectations for either, alone or combined, than assume stacking supplements multiplies the effect.
When to see a doctor
Both are generally considered safe for short-term use in healthy adults, but magnesium can interact with certain antibiotics, and both can interact with blood pressure medication, so check with a doctor or pharmacist before starting, especially if you take other medications. If 3am waking happens most nights regardless of what you try, or comes with snoring or gasping, that's worth raising directly, since sleep apnea is a common cause neither supplement will touch.
Sources
- "Melatonin for the Treatment of Insomnia: A 2022 Update." CADTH Health Technology Review, 2022. Full text.
- See the full source lists in Does Magnesium Actually Help You Stay Asleep? and What Melatonin Does and Doesn't Do for the individual trials behind each claim here.