Magnesium and Melatonin: Can You Take Them Together, and Which Is Better for Sleep?
Magnesium and melatonin are two of the most common sleep supplements, and many products now combine them. We read the trials that gave them together, including one that compared each on its own, and what the NIH says about each, on September 24, 2026.
It is not medical advice. If you take any medication, ask a pharmacist before adding either.
The Short Answer
- We found no known interaction between the two. The NIH magnesium fact sheet’s list of interactions does not include melatonin, and the melatonin cautions we found concern epilepsy and blood thinners, not magnesium. Combination products exist, and three trials gave them together.
- Melatonin appears to do more of the work. In the one trial that compared them head to head, 84 women with polycystic ovary syndrome, the abstract reports sleep score improvements with melatonin alone and with the combination, and none for magnesium alone.
- The combination trials were small and positive. Forty-three older adults in long-term care slept better on melatonin, magnesium and zinc than on placebo; 35 adults with poor sleep improved on a melatonin and magnesium drink, though their average sleep scores still indicated poor sleep.
- Doses matter. The trials used 1.9 to 5 mg of melatonin and 200 to 225 mg of elemental magnesium. Many combination products disclose less, or do not disclose the magnesium amount at all.
- Each has its own limits. The NIH upper limit for supplemental magnesium is 350 mg a day, and melatonin labels are often inaccurate.
Can You Take Them Together?
No interaction between magnesium and melatonin appears in the sources we read. The NIH Office of Dietary Supplements lists magnesium interactions with bisphosphonates, tetracycline and quinolone antibiotics, diuretics and proton pump inhibitors, and does not list melatonin. For melatonin, the NCCIH notes that people with epilepsy or on blood thinners need medical supervision, and that long-term safety information is lacking. Our melatonin guide and magnesium guide cover each in full.
Not finding an interaction is not proof of safety. The trials below did not report safety results in their abstracts, and none ran longer than 8 weeks.
What the Trials That Combined Them Found
| Trial | Who | What they took | What it found |
|---|---|---|---|
| Rondanelli et al., 2011 | 43 long-term care residents with primary insomnia, average age 78 | 5 mg melatonin, 225 mg magnesium and 11.25 mg zinc nightly, or placebo, for 8 weeks | Better sleep quality scores than placebo, plus better ease of falling asleep, morning alertness and total sleep time measured by a wearable sensor |
| Carlos et al., 2024 | 35 otherwise healthy adults with poor sleep, crossover design | 1.9 mg melatonin and 200 mg elemental magnesium in a coffee-pod drink before sleep, or placebo, 4 weeks each | Improvements in sleep efficiency, time to fall asleep and total sleep time favored the supplement; average sleep quality scores still indicated poor sleep in both conditions |
| Alizadeh et al., 2021 | 84 women aged 18 to 40 with polycystic ovary syndrome | Magnesium, melatonin, both, or placebo, for 8 weeks | Sleep quality scores improved in the melatonin and combination groups; the abstract reports no such change for magnesium alone |
Each has limits worth knowing. The first included zinc, so it cannot say what the magnesium and melatonin did on their own. The second was run by researchers including authors affiliated with the company behind the product tested. The third was designed mainly around hormones and metabolism in polycystic ovary syndrome, not insomnia, and each of its four groups had about 21 women; its authors declare no conflicts.
Is Melatonin or Magnesium Better for Sleep?
On the evidence we read, melatonin. It has the larger body of research: a meta-analysis of 19 studies found it shortened the time to fall asleep by about 7 minutes and lengthened sleep by about 8, and it has a better case for jet lag and late body clocks. Magnesium’s evidence is rated low to very low certainty in a 2026 review of 12 trials, with one small positive trial of the glycinate form at 250 mg of elemental magnesium. In the only trial that compared them directly, the abstract reports a sleep improvement with melatonin and with the combination, and none for magnesium alone.
That does not make melatonin a good choice for everyone. For chronic insomnia in adults, the American Academy of Sleep Medicine suggests clinicians not use it (a weak recommendation), and the strongest recommendation in the guidelines goes to cognitive behavioral therapy for insomnia. Our ranking of sleep supplements by evidence puts both in context.
Products That Combine Them
A single-ingredient product states its full dose, so you can compare it with the trials above. A combination product often states the melatonin but hides the magnesium inside a proprietary blend.
Yu Sleep, a liquid supplement we review, combines both with eight other ingredients. It discloses 0.9 mg of melatonin per serving, below the 1.9 to 5 mg in the combination trials. Its magnesium glycinate sits in a blend with no individual amount; from the label order, the most it can hold is about 45 mg of elemental magnesium, well below the 200 to 225 mg in those trials. So it is a low-dose combination, not a match for the doses tested. Our Yu Sleep vs melatonin and Yu Sleep vs magnesium guides compare it with each on its own. It also contains 5-HTP, so check with a prescriber if you take a medicine that affects serotonin.
How to Take Them Safely
- Keep supplemental magnesium within 350 mg a day from all supplements and medications combined, the NIH upper limit. Count any combination product.
- Check the elemental magnesium on the label, not only the “magnesium glycinate” weight.
- Ask about the melatonin dose. The NCCIH notes uncertainty about what dose to use and when to take it, and labels can be inaccurate: tests have found melatonin from 83% below to 478% above the labeled amount.
- Mind the timing if you take a bisphosphonate or a tetracycline or quinolone antibiotic; the NIH gives specific spacing for magnesium.
- Ask a healthcare provider if you have epilepsy, take a blood thinner, have kidney problems, are pregnant, or have ongoing insomnia.
Questions
Can I take magnesium glycinate and melatonin together?
We found no known interaction, and trials have given them together for up to 8 weeks. Stay within the magnesium upper limit, and ask a pharmacist if you take other medicines.
Is it better to take magnesium or melatonin for sleep?
Melatonin has more and more consistent evidence, and in the one trial that compared them, the abstract reports sleep improvements only in the groups taking melatonin. The effect is still small on average.
Should I take them at the same time?
The combination trials gave them together before bed; one gave its supplement one hour before bedtime. We found no study comparing different timings.
See Also
Melatonin for Sleep and Magnesium Glycinate for Sleep cover each ingredient in depth. Best Natural Sleep Supplements ranks nine ingredients by evidence.
Sources Cited in This Guide
- Rondanelli M, et al. “The effect of melatonin, magnesium, and zinc on primary insomnia in long-term care facility residents in Italy: a double-blind, placebo-controlled clinical trial.” J Am Geriatr Soc. 2011. Read September 24, 2026 (abstract). PMID 21226679
- Carlos RM, et al. “The effects of melatonin and magnesium in a novel supplement delivery system on sleep scores, body composition and metabolism in otherwise healthy individuals with sleep disturbances.” Chronobiol Int. 2024. Read September 24, 2026 (abstract and author affiliations). PMID 38745424
- Alizadeh M, et al. “Metabolic and hormonal effects of melatonin and/or magnesium supplementation in women with polycystic ovary syndrome: a randomized, double-blind, placebo-controlled trial.” Nutr Metab (Lond). 2021. Read September 24, 2026 (abstract and conflict statement). PMID 34092248
- National Institutes of Health, Office of Dietary Supplements. “Magnesium: Fact Sheet for Health Professionals.” Read September 24, 2026. NIH ODS
- Our guides on melatonin and magnesium glycinate, which cite the melatonin meta-analysis, the NCCIH and AASM material, the 2026 magnesium review and the bisglycinate trial in full.
This guide is for information and is not medical advice. We may earn a commission if you buy through the links above, at no extra cost to you. See our affiliate disclosure.
If this guide was useful, send it to someone who is also awake at 3 a.m.