Melatonin and magnesium are not two versions of the same thing. Melatonin is a hormone your body uses to signal night, sold over the counter in the US as a supplement, and its best-documented use is shifting sleep timing, as with jet lag. Magnesium is an essential mineral with a much thinner body of sleep research behind it. Our verdict: neither is a proven fix for ongoing poor sleep, melatonin has more evidence but also more caveats, and magnesium is gentler on paper but mostly unproven for sleep. Persistent trouble sleeping is a reason to see a clinician, not to stack supplements.

We compared the published research, US label rules and known interactions for both, using the NIH Office of Dietary Supplements fact sheets and the American Academy of Sleep Medicine (AASM) guidance as anchors. We are reviewers, not sleep physicians, and nothing here tells you what to take. If you are pregnant, take any regular medication, or are thinking of either supplement for a child, talk to your doctor first.

Two very different substances on the same shelf

Melatonin is made by the pineal gland as darkness falls, and it acts more like a timing signal than a sedative. That is why research interest centers on circadian problems such as jet lag and delayed sleep phase. In much of Europe and the UK it is a prescription medicine, while in the US it is sold as a dietary supplement, which means the FDA does not approve it for effectiveness before sale.

Magnesium is a mineral involved in hundreds of enzyme reactions, including nerve and muscle function. It reaches you from leafy greens, nuts, seeds, legumes and whole grains as well as supplements. The idea that it helps sleep leans largely on its role in the nervous system and on small trials, not on large, consistent findings. A low intake from food is a different question from a sleep benefit, and only a clinician can tell you whether you are actually short.

FactorMelatoninMagnesium
What it isA hormone that signals nightAn essential dietary mineral
Strongest evidenceSleep timing, such as jet lagCorrecting a deficiency; sleep evidence is limited
Main guidanceAASM 2017 insomnia guideline suggests against it for chronic insomniaNo sleep guideline endorses it
Label accuracy concernDocumented in two independent studiesLess studied, check for third-party testing
Known interactionsSedatives, blood thinners, diabetes and immune medicinesSome antibiotics, osteoporosis drugs, kidney disease

What the melatonin evidence shows, and what it does not

A 2013 meta-analysis in PLOS ONE (Ferracioli-Oda and colleagues) found melatonin shortened the time to fall asleep by about seven minutes on average across trials in primary sleep disorders, a real but modest effect. The AASM's 2017 clinical practice guideline for chronic insomnia in adults suggested clinicians not use melatonin for that purpose, rating the evidence as weak. For timing problems the picture is more favorable, which is why jet lag is the use most often discussed.

Safety signals deserve a mention too. An observational analysis of health records presented at the American Heart Association's Scientific Sessions in November 2025 linked long-term melatonin use in adults with insomnia to more heart failure diagnoses. It was not peer reviewed at presentation and cannot show that melatonin caused anything, but it is a reason long-term use belongs in a conversation with a doctor rather than a habit.

Flat illustration of a crescent moon over a bedside table with two plain supplement bottles, teal and mint palette

Melatonin labels are not always accurate

Two studies found what is on the bottle can differ widely from what is in it. A 2017 analysis in the Journal of Clinical Sleep Medicine (Erland and Saxena) tested 31 Canadian melatonin products and found contents ranging from well below to several times above the label, with serotonin detected in some. A 2023 research letter in JAMA (Cohen and colleagues) tested melatonin gummies sold in the US and found most did not match their labels, and some also listed CBD among their ingredients.

Children are a separate concern. The CDC reported in 2022 that pediatric melatonin ingestions reported to poison centers rose sharply over the prior decade, and the AASM has issued a health advisory urging parents to talk to a pediatrician before giving it to kids. Gummies that look like candy belong out of reach.

What the magnesium evidence shows

The sleep case for magnesium is thin. A 2021 systematic review in BMC Complementary Medicine and Therapies (Mah and Pitceathly) looked at oral magnesium for insomnia in older adults and rated the evidence as low quality, too limited to support confident recommendations. Much of the online enthusiasm rests on small trials and on the fact that many adults eat less magnesium than recommended.

Form also gets attention. Glycinate, citrate and oxide differ in how they are absorbed and how likely they are to loosen stools, which we cover in our magnesium glycinate vs citrate comparison and best magnesium guide. Brands such as Thorne sell glycinate versions with third-party testing programs, but a better-absorbed form is not evidence that it helps sleep. The NIH sets an upper limit for magnesium from supplements because too much can cause diarrhea and, rarely, more serious problems, especially with reduced kidney function.

Interactions and who should ask first

Melatonin can add to the effect of sedatives, alcohol and other sleep medicines, and the NIH notes possible interactions with blood thinners, diabetes medicines, blood pressure drugs and immunosuppressants. Magnesium can reduce absorption of some antibiotics (tetracyclines and quinolones) and of bisphosphonates used for osteoporosis, and people with kidney disease may not clear it well. Pregnancy, breastfeeding, epilepsy, depression and autoimmune conditions are all reasons to ask a doctor or pharmacist before trying either.

Before any supplement, the basics carry more evidence: consistent sleep and wake times, a dark and cool room, less caffeine and alcohol late in the day, and cognitive behavioral therapy for insomnia (CBT-I), which the American College of Physicians recommends as the first-line treatment for chronic insomnia. Snoring, gasping at night or daytime sleepiness can point to sleep apnea, which no supplement addresses. Our mattress guide and white noise machine roundup cover the environment side.

The bottom line: melatonin has more evidence and more caveats, magnesium is gentler but largely unproven for sleep, and anyone with sleep trouble most nights should see a clinician before reaching for either.