guide
    magnesium
    melatonin

    Magnesium and Melatonin Together: Is It Safe?

    What trials that used both show, how to time them, and who should check with a pharmacist first.

    Remedy Routes Research TeamOctober 30, 202612 min read

    The short answer

    Yes, healthy adults can usually take magnesium and melatonin together. Neither the NIH magnesium fact sheet nor the NCCIH melatonin page lists the other as an interaction1, 2. In an 8-week trial of 43 care-home residents with insomnia, a nightly supplement with 5 mg melatonin, 225 mg magnesium and 11.25 mg zinc improved sleep quality scores more than placebo3.

    The catch is the evidence. Only one small trial, not designed around sleep, compared the pair with each ingredient alone, so a benefit beyond either one is unproven. The harder questions are about your medicines and your kidneys, not about the two supplements meeting each other.

    Can you take or drink magnesium and melatonin at the same time?

    Yes, they can be taken together. They work through different routes, and the sources we read describe no absorption clash between them.

    Melatonin is a hormone your brain makes in response to darkness; it helps time your 24-hour body clock2. Magnesium is a mineral that acts as a natural NMDA antagonist and GABA agonist, and the authors of one trial say it is involved in regulating sleep4. The liver clears melatonin mainly through the CYP1A2 enzyme5, while magnesium leaves through the kidneys1.

    The NIH list of magnesium's drug interactions names bisphosphonates, tetracycline and quinolone antibiotics, diuretics and proton pump inhibitors. Melatonin is not on it1.

    Two older findings suggest the two may influence each other, but neither shows a problem:

    • In rats, pretreatment with magnesium raised night-time activity of a key melatonin-making enzyme in the pineal gland6. That is animal work from 1985 and does not show what happens in people.
    • In people, 500 mg of magnesium a day for 8 weeks raised blood melatonin in 46 older adults compared with placebo4. That dose is above the 350 mg supplemental upper limit, and melatonin was one of several blood markers measured, not the trial's main goal.

    Does taking them together work better than either alone?

    It is not proven. Four trials gave magnesium and melatonin together, and each reported better sleep scores. Only one included arms for each ingredient alone, and sleep was not its main goal.

    • 43 care-home residents, 8 weeks: 5 mg melatonin, 225 mg magnesium and 11.25 mg zinc taken 1 hour before bed. Sleep quality (PSQI) improved by 6.8 points more than placebo (95% CI 5.4 to 8.3)3.
    • 60 adults with insomnia, 3 months: a supplement with 1 mg melatonin, 175 mg liposomal magnesium oxide and B vitamins, taken 1 hour before sleep. Athens Insomnia Scale scores averaged 10.50 versus 15.13 in the control group7.
    • 35 adults with poor sleep, 4 weeks, crossover: 1.9 mg melatonin plus 200 mg magnesium before sleep improved sleep efficiency and latency over placebo. Average PSQI scores still stayed above 5, the poor-sleep range8.
    • 84 women with polycystic ovary syndrome, 8 weeks: this trial had separate magnesium, melatonin, combined and placebo arms. PSQI fell significantly in the melatonin and the combined groups, and the abstract does not report that the combination beat melatonin alone9.

    These trials are small and mostly short, and two of the four used products with other ingredients (zinc, B vitamins). The polycystic ovary syndrome trial was designed around metabolic outcomes, with sleep as a secondary measure. Treat the results as hints rather than proof.

    For your own sleep, the better question is whether each ingredient helps on its own. See magnesium for sleep quality and melatonin for sleep quality for the full evidence.

    What does each one do on its own?

    Each has a modest, uncertain effect on sleep. Melatonin's evidence is larger, and magnesium's is thinner and lower quality.

    Melatonin

    A meta-analysis of 19 trials in 1,683 people found melatonin shortened the time to fall asleep by 7.06 minutes and added 8.25 minutes of sleep10. A later review of 24 trials in chronic insomnia found no significant benefit in adults whose insomnia was not linked to another condition, though it may help children and teenagers11. Practice guidelines from the American Academy of Sleep Medicine (2017) and American College of Physicians (2016) found too little strong evidence to recommend melatonin for chronic insomnia, and the ACP prefers cognitive behavioral therapy for insomnia first2.

    Magnesium

    A review of 3 trials in 151 older adults found magnesium cut the time to fall asleep by 17.36 minutes (95% CI 7.44 to 27.27), but the evidence was low to very low quality12. A 2026 review of 12 trials concluded the evidence does not support magnesium as a routine insomnia treatment, with inconsistent results and low-certainty evidence13. In 155 adults with poor sleep, 250 mg of magnesium bisglycinate lowered Insomnia Severity Index scores by 3.9 points versus 2.3 for placebo; the effect size was small (Cohen's d = 0.2)14.

    For the heart, the NIH says trials show magnesium supplements lower blood pressure only marginally1. Magnesium may matter most for sleep if you are low on it. That trial's exploratory analysis hinted at larger gains in people with lower dietary intake14.

    Can you take magnesium glycinate and melatonin together?

    Yes. Glycinate is only the form of magnesium, and nothing we read suggests it changes how it sits with melatonin.

    No trial we found tested glycinate and melatonin together. The closest data is the 250 mg magnesium bisglycinate trial above, which tested the form without melatonin14.

    No form has been proven best for sleep. The NIH notes that forms that dissolve well in liquid are absorbed better, and that aspartate, citrate, lactate and chloride tend to be absorbed better than oxide and sulfate1. It also lists carbonate, chloride, gluconate and oxide as the forms most often reported to cause diarrhea1.

    For form-by-form comparisons, see our guides to glycinate versus citrate and threonate versus glycinate. Check the label for elemental magnesium, because that is the amount the Supplement Facts panel declares1.

    Is magnesium better taken in the morning or night?

    The trials with a stated schedule gave both about 1 hour before bed3, 7, so that is the best-supported plan. We found no trial that compared morning with evening magnesium.

    A dose-response meta-analysis of 26 trials found melatonin's effect on falling asleep peaked at 4 mg a day. It also suggested that taking it about 3 hours before the desired bedtime may work better than the common 30 minutes before15.

    For magnesium alone, see when to take magnesium. A simple plan:

    • With dinner or an hour before bed: magnesium, with food if it upsets your stomach.
    • 1 to 3 hours before bed: melatonin. The trials gave it 1 hour before; one meta-analysis suggests earlier may work better3, 15.
    • Bisphosphonates and some antibiotics: keep these at least 2 hours from magnesium. Tetracycline and quinolone antibiotics need at least 2 hours before or 4 to 6 hours after it1.

    Three trials that reported doses used 1 to 5 mg of melatonin and 175 to 225 mg of magnesium3, 7, 8. Those are trial doses, not targets. The adult upper limit for supplemental magnesium is 350 mg a day1.

    What are the side effects of taking them together?

    No trial we read reported side effects unique to the pair. The risks come from each supplement separately.

    Melatonin. In a review of 37 trials, the most common side effects were daytime sleepiness (1.66%), headache (0.74%) and dizziness (0.74%). Most cleared within a few days or on stopping16. A meta-analysis of doses of 10 mg or more found more drowsiness, headache and dizziness than placebo (rate ratio 1.40), but no detectable rise in serious events. That safety result came from only 4 low-bias studies with wide uncertainty17. Another review found effects on blood pressure and heart rate in a few studies, possibly linked to dose, timing and antihypertensive drugs18.

    Magnesium. High doses from supplements can cause diarrhea, nausea and abdominal cramping. Very high doses can cause toxicity, especially when kidney function is impaired1.

    Next-morning grogginess is the practical worry, since both are used for sleep. In the care-home trial, residents taking the melatonin-magnesium-zinc supplement scored better than placebo on questionnaire items for next-morning alertness (P = .001) and how they felt on waking (P = .005)3. That is one small trial in older adults, and it did not test grogginess directly.

    Who should be careful with magnesium and melatonin?

    Anyone with kidney disease, anyone on the medicines below, and parents should check with a pharmacist or doctor first.

    • Kidney disease: the risk of magnesium toxicity rises when kidneys cannot clear the excess1. That applies to any magnesium supplement, glycinate included.
    • Blood thinners and epilepsy: the NCCIH says people with epilepsy and those on blood thinners need medical supervision when taking melatonin2.
    • Antidepressants and other sedating drugs: a pharmacy surveillance study described severe sedation in a 19-year-old taking citalopram, nortriptyline and oxycodone after melatonin was added. Lab tests showed melatonin products can inhibit CYP1A2, CYP2C19 and CYP3A719. See our guide to SSRIs and supplements.
    • Bisphosphonates and some antibiotics: magnesium can block their absorption. Take bisphosphonates at least 2 hours before or after magnesium, and tetracycline or quinolone antibiotics at least 2 hours before or 4 to 6 hours after it1.
    • Diuretics and acid reducers: long-term thiazide diuretics such as hydrochlorothiazide and loop diuretics can increase urinary magnesium loss, while potassium-sparing diuretics reduce it. Proton pump inhibitors taken for more than a year can cause low magnesium1. Ask before adding a supplement either way.
    • Pregnancy and breastfeeding: research on melatonin's safety in pregnant or breastfeeding women is lacking2.
    • Older adults: melatonin may stay active longer and cause daytime drowsiness, and the 2015 AASM guideline recommends against it in dementia2.
    • Children: the NCCIH advises speaking with a health care provider first, and says melatonin's effects on puberty and hormones in children are unknown. Supplemental magnesium upper limits are 65 mg at ages 1 to 3 and 110 mg at ages 4 to 8, so adult doses do not apply2, 1. A CDC report estimated 11,000 emergency visits for unsupervised melatonin ingestion by children aged 5 and under from 2019 to 20222.

    Labels can also mislead. A 2017 study of 31 melatonin supplements found that for most the amount did not match the label, and 26% contained serotonin2.

    What should you do with this?

    Start with one supplement, give it a fair trial, then add the second only if you still need it. That way you know which one is doing the work.

    • If you sleep poorly and your diet is low in magnesium: try magnesium first. Early signs of deficiency are loss of appetite, nausea, fatigue and weakness, but symptomatic deficiency is uncommon in healthy people1. Our magnesium deficiency page covers who tends to run low.
    • If you struggle to fall asleep at the right clock time: try low-dose melatonin, taken earlier than you think. The NCCIH says melatonin may help with jet lag and delayed sleep-wake phase disorder2.
    • If neither helps after a few weeks: see a clinician. Guidelines put cognitive behavioral therapy for insomnia ahead of melatonin2.

    For the wider picture, see our complete guide to sleep supplements and the sleep optimization topic. Our guide on what not to take with magnesium covers other pairings.

    Supplements in this guide

    Related health goals

    Related conditions

    Frequently Asked Questions

    What is the best type of magnesium for me?
    No form has been proven best for sleep. The NIH says forms that dissolve well in liquid, such as citrate, are absorbed better than oxide. Glycinate is a common choice, but the NIH does not rank it, and the one trial we found used 250 mg of magnesium bisglycinate.
    Can I take hydrochlorothiazide with magnesium?
    The NIH fact sheet does not say to avoid the combination, but it does say thiazide diuretics such as hydrochlorothiazide can increase magnesium loss in urine and lead to depletion, while potassium-sparing diuretics reduce magnesium excretion. Ask your pharmacist or prescriber before adding a supplement.
    What are the signs your body needs magnesium?
    Early signs of deficiency include loss of appetite, nausea, vomiting, fatigue and weakness. Later signs include numbness, muscle cramps, seizures and abnormal heart rhythms. The NIH says symptomatic deficiency is uncommon in healthy people because kidneys limit magnesium loss, so these symptoms deserve a medical evaluation rather than self-treatment.
    Is taking magnesium every day good for your heart?
    The evidence is modest. The NIH fact sheet says trials suggest magnesium supplements lower blood pressure only marginally, and that more research is needed on cardiovascular disease. Stay under the 350 mg supplemental upper limit unless a clinician advises otherwise.
    What form of magnesium do cardiologists recommend?
    We found no guideline in the sources we read that names one form for heart health. The NIH fact sheet does not rank forms for cardiovascular benefit. If you take heart medicines, ask your cardiologist or pharmacist which form and dose suit you.
    Which form of magnesium is best for anxiety and heart palpitations?
    We found no trial comparing forms for either. Palpitations have many causes and should be checked by a clinician before you try a supplement. The NIH notes that severe magnesium deficiency can cause abnormal heart rhythms, but that deficiency is uncommon in healthy people.

    How we researched this

    We searched PubMed and the Firecrawl research index for trials, systematic reviews and safety reports on magnesium, melatonin and the two together, and read the NIH Office of Dietary Supplements magnesium fact sheet and the NCCIH melatonin page. We cited 17 journal papers and 2 NIH pages, favoring systematic reviews and randomized trials in adults. No trial isolated the effect of the pair, and the trials that used both were small and mostly short, so the evidence for a benefit from the combination is limited. Researched on October 30, 2026.

    References

    1. National Institutes of Health, Office of Dietary Supplements. Magnesium: Fact Sheet for Health Professionals (updated January 6, 2026). https://ods.od.nih.gov/factsheets/Magnesium-HealthProfessional/
    2. National Center for Complementary and Integrative Health. Melatonin: What You Need To Know (last updated May 2024). https://www.nccih.nih.gov/health/melatonin-what-you-need-to-know
    3. 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;59(1):82-90. doi:10.1111/j.1532-5415.2010.03232.x Our study summary.
    4. Abbasi B, et al. The effect of magnesium supplementation on primary insomnia in elderly: A double-blind placebo-controlled clinical trial. J Res Med Sci. 2012;17(12):1161-9. https://pubmed.ncbi.nlm.nih.gov/23853635/ Our study summary.
    5. Papagiannidou E, et al. Potential drug interactions with melatonin. Physiol Behav. 2014;131:17-24. doi:10.1016/j.physbeh.2014.04.016
    6. Morton DJ, et al. Effect of magnesium ions on rat pineal N-acetyltransferase (EC 2.3.1.5) activity. J Pineal Res. 1985;2(4):387-91. doi:10.1111/j.1600-079x.1985.tb00718.x
    7. Djokic G, et al. The Effects of Magnesium - Melatonin - Vit B Complex Supplementation in Treatment of Insomnia. Open Access Maced J Med Sci. 2019;7(18):3101-3105. doi:10.3889/oamjms.2019.771
    8. 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;41(6):817-828. doi:10.1080/07420528.2024.2353225
    9. 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;18(1):57. doi:10.1186/s12986-021-00586-9
    10. Ferracioli-Oda E, et al. Meta-analysis: melatonin for the treatment of primary sleep disorders. PLoS One. 2013;8(5):e63773. doi:10.1371/journal.pone.0063773 Our study summary.
    11. Choi K, et al. Efficacy of melatonin for chronic insomnia: Systematic reviews and meta-analyses. Sleep Med Rev. 2022;66:101692. doi:10.1016/j.smrv.2022.101692 Our study summary.
    12. Mah J, et al. Oral magnesium supplementation for insomnia in older adults: a Systematic Review & Meta-Analysis. BMC Complement Med Ther. 2021;21(1):125. doi:10.1186/s12906-021-03297-z Our study summary.
    13. Lopresti AL, et al. Magnesium Supplementation for Sleep in Adults: A Systematic Review of Randomized Controlled Trials. J Diet Suppl. 2026;23(5):553-581. doi:10.1080/19390211.2026.2719670
    14. Schuster J, et al. Magnesium Bisglycinate Supplementation in Healthy Adults Reporting Poor Sleep: A Randomized, Placebo-Controlled Trial. Nat Sci Sleep. 2025;17:2027-2040. doi:10.2147/NSS.S524348 Our study summary.
    15. Cruz-Sanabria F, et al. Optimizing the Time and Dose of Melatonin as a Sleep-Promoting Drug: A Systematic Review of Randomized Controlled Trials and Dose-Response Meta-Analysis. J Pineal Res. 2024;76(5):e12985. doi:10.1111/jpi.12985
    16. Besag FMC, et al. Adverse Events Associated with Melatonin for the Treatment of Primary or Secondary Sleep Disorders: A Systematic Review. CNS Drugs. 2019;33(12):1167-1186. doi:10.1007/s40263-019-00680-w Our study summary.
    17. Menczel Schrire Z, et al. Safety of higher doses of melatonin in adults: A systematic review and meta-analysis. J Pineal Res. 2022;72(2):e12782. doi:10.1111/jpi.12782
    18. Foley HM, et al. Adverse events associated with oral administration of melatonin: A critical systematic review of clinical evidence. Complement Ther Med. 2019;42:65-81. doi:10.1016/j.ctim.2018.11.003
    19. Foster BC, et al. Melatonin Interaction Resulting in Severe Sedation. J Pharm Pharm Sci. 2015;18(2):124-31. doi:10.18433/j3ss35

    Continue Reading

    All articles