Melatonin vs magnesium glycinate — which is better for sleep?
These two are the most-recommended over-the-counter sleep supplements, but they fix different problems. Melatonin is a circadian-rhythm signal — its job is to tell your brain it's biological night. Magnesium glycinate is a neuromuscular and stress-axis modulator — its job is to dampen the arousal that's keeping you awake. Pick the wrong one for your problem and the result feels like the supplement "didn't work".
Quick verdict
| Sleep complaint | Better choice | Why |
|---|---|---|
| Jet lag, shift work, delayed sleep phase | Melatonin | Phase-shifting effect is what melatonin uniquely does. 0.3–0.5 mg taken 4–6 hours before target bedtime advances circadian rhythm. |
| "Tired but wired" — racing thoughts at bedtime | Magnesium glycinate | Glycine is a calming co-agonist; magnesium downregulates NMDA-type excitatory signalling. Best fit for anxiety-driven insomnia. |
| Sleep fragmentation / waking at 3am | Magnesium glycinate | Standard immediate-release melatonin clears the blood in 1–2 hours and rarely improves middle-of-the-night awakenings. Magnesium has indirect support for sleep continuity. |
| Sleep onset > 30 min in older adults | Melatonin (low dose) | Endogenous melatonin declines with age. 0.5–2 mg has the cleanest evidence in adults >55. Higher doses don't add benefit. |
| Generic, low-stakes sleep support — first try | Magnesium glycinate | Tier 1, 4/5 evidence, very high safety; addresses likely magnesium insufficiency in the diet at the same time. |
How they compare on the things that matter
Mechanism — they're not redundant
Melatonin is a hormone produced by the pineal gland in response to darkness. Supplemental melatonin acts on MT1 and MT2 receptors in the suprachiasmatic nucleus (the brain's master clock) to either reinforce a normal evening signal or shift the clock to a new time zone. It is not a sedative — at the right time, in the right dose, it nudges the circadian system; at the wrong time it can make sleep worse.
Magnesium glycinate provides two active components. Magnesium is a cofactor in over 300 enzymatic reactions; relevant to sleep, it modulates GABAergic inhibition and downregulates NMDA-type glutamate signalling, which together reduce neuronal excitability. Glycine, the carrier amino acid, has independent evidence for promoting sleep onset at higher doses (3 g) and works as a calming co-agonist at the glycine site of the NMDA receptor.
Evidence base
- Melatonin — Tier 2 overall, Tier 1 at low physiological doses. Strongest evidence for jet lag, shift work, and delayed sleep phase syndrome. Modest benefit for primary insomnia in older adults; weaker in adults <55. Mainstream meta-analyses (Auld 2017, Ferracioli-Oda 2013) report sleep-onset reductions of 7–15 minutes — real but modest. Most products are massively over-dosed at 3–10 mg; physiological doses of 0.3–0.5 mg often work as well or better.
- Magnesium glycinate — Tier 1. Several small RCTs in older adults with insomnia report improved sleep efficiency and reduced sleep-onset latency, particularly when baseline magnesium is low. Effect size is modest but consistent. Glycine itself has 3 g sleep-onset trials with positive results.
Side effects and tolerance
Melatonin can cause vivid dreams, morning grogginess (especially at doses >1 mg), and — confusingly — daytime sleepiness if mistimed. There is no convincing evidence of long-term tolerance or dependence at standard doses, but the supply chain is known to be lax: a 2023 JAMA analysis of melatonin gummies found actual dose ranged from 74% to 347% of the labelled value. Choose a third-party tested brand and start low.
Magnesium glycinate is among the best-tolerated forms of magnesium — most users handle 400 mg elemental without GI upset (whereas citrate and oxide reliably loosen stools at the same dose). The main interaction concern is timing: separate magnesium dosing by 2 hours from bisphosphonates, tetracyclines, or quinolones to avoid chelation interference.
Stacking them
The two are mechanistically non-overlapping and stack cleanly. A common evidence-based combination is 0.3–0.5 mg melatonin taken 30–60 minutes before bed plus 200–400 mg elemental magnesium glycinate with the evening meal. There is no documented adverse interaction. The reason to start with one rather than both is diagnostic — you want to know which mechanism actually moved the needle for you.
What the price difference buys you
Both are inexpensive. A 60-day supply of low-dose melatonin runs about $8–15; a 60-day supply of magnesium glycinate at 400 mg/day runs about $15–25. The premium for "extended-release" or "time-release" melatonin (designed to address middle-of-the-night awakenings) is real — but the evidence base is thinner than for low-dose immediate-release for sleep onset.
Who should not take each
Melatonin should be used cautiously in autoimmune disease (theoretical immune-modulating concern), in adolescents (limited long-term data), and during pregnancy or lactation (not enough safety data). It can interact with sedatives, antidepressants, and warfarin. People on hormonal birth control may experience higher melatonin levels than expected.
Magnesium glycinate should not be supplemented without supervision in significant kidney disease (eGFR < 30) — the kidneys clear magnesium, and impaired clearance can produce hypermagnesemia. Otherwise it is among the most universally safe supplements available.
What we'd actually buy
For circadian misalignment (jet lag, shift work, persistent late sleep): 0.3–0.5 mg melatonin from a USP-Verified or NSF-tested brand, taken 4–6 hours before target sleep time for phase-shifting, or 30 minutes before bed for routine support in older adults. Skip the 5 mg and 10 mg gummies — more is not better and over-dosing is associated with worse next-day grogginess.
For stress-related sleep, muscle tension, or general sleep support: 200–400 mg elemental magnesium glycinate with dinner. Brands matter less here than the elemental dose on the label — many "magnesium glycinate" products list the gross compound weight, which dramatically overstates the effective dose.
Sources
- Auld F, et al. Evidence for the efficacy of melatonin in the treatment of primary adult sleep disorders. Sleep Med Rev. 2017;34:10–22. PMID: 28648359
- Ferracioli-Oda E, et al. Meta-analysis: melatonin for the treatment of primary sleep disorders. PLoS One. 2013;8(5):e63773. PMID: 23691095
- Cohen PA, et al. Quantity of melatonin and CBD in melatonin gummies sold in the US. JAMA. 2023;329(16):1401–1402. PMID: 37097362
- 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–1169. PMID: 23853635
- Mah J, Pitre T. Oral magnesium supplementation for insomnia in older adults: a systematic review and meta-analysis. BMC Complement Med Ther. 2021;21:125. PMID: 33865376
- Bannai M, Kawai N. New therapeutic strategy for amino acid medicine: glycine improves the quality of sleep. J Pharmacol Sci. 2012;118(2):145–148. PMID: 22293292