Melatonin and magnesium.
Both are sold as sleep aids, and the evidence behind them is smaller than the shelves suggest.
This page reports what studies found. It is not advice to take anything, and it gives no doses. Talk to a doctor or pharmacist first, especially if you are pregnant or breastfeeding, take any medicine, or have a health condition.
Melatonin
Melatonin is the hormone the body releases in the evening, and it is also sold as a pill. Across 19 trials with 1,683 people with sleep problems, it helped them fall asleep about seven minutes faster and sleep about eight minutes longer (Ferracioli-Oda, 2013): a real but small effect. The American Academy of Sleep Medicine suggests not using it for long-lasting insomnia (Sateia, 2017).
It has more support for jet lag: in nine of ten trials it eased jet lag after crossing five or more time zones, especially flying east, while taking it at the wrong time can slow the adjustment (Herxheimer, 2002). For night-shift workers it may add about 24 minutes of daytime sleep, on low-quality evidence, and does not help them fall asleep faster (Liira, 2014).
How it is sold
How it is sold depends on the country. In the United States it is a dietary supplement (NCCIH). In the UK it is a medicine on prescription only (NHS). In the European Union the licensed medicine is prescription-only, for adults aged 55 and over (European Medicines Agency), while some countries also allow low-dose food supplements. In Australia people over 55 can buy a slow-release form over the counter, and everyone else needs a prescription (healthdirect).
Labels are not always right. In 31 products tested in Canada, the real amount ranged from 83% less to 478% more than the label said, and some contained serotonin (Erland, 2017); 22 of 25 gummies tested in the US were mislabelled (Cohen, 2023). Reports of children swallowing melatonin to US poison centres rose 530% between 2012 and 2021 (Lelak, 2022), so if you keep it at home, keep it out of children's reach.
Magnesium
Three small trials with 151 older adults found that magnesium helped people fall asleep about 17 minutes faster, with no clear change in total sleep, and the certainty of that evidence is low to very low (Mah and Pitre, 2021). Across nine studies, magnesium levels were linked with sleep in observational studies, but the trials disagreed with each other (Arab, 2023), and another review of small trials was of low quality (Rawji, 2024). Most people studied were older adults, so the results may not apply to younger people.
Too much magnesium from supplements, laxatives or antacids can be dangerous, almost always in people whose kidneys work less well (Van Laecke, 2019), and magnesium can interact with some medicines, including some antibiotics, diuretics and acid-reducing drugs (Gröber, 2019).
Before you try either
Before you try either, talk to a doctor or pharmacist, especially if you are pregnant or breastfeeding, take any medicine (blood thinners, antibiotics, diuretics and acid-reducing drugs among them), have kidney disease or epilepsy, are older, or are thinking of giving it to a child.
Neither is a treatment for long-lasting insomnia: cognitive behavioural therapy for insomnia is the first choice (Edinger, 2021). Perdura does not recommend either one; it shows the sleep you log, so you can see your own pattern.
Perdura shows the sleep you log, night by night, so you can see your own pattern. Free, no card.
Sources
- Ferracioli-Oda E et al. Meta-analysis: melatonin for the treatment of primary sleep disorders. PLoS One. 2013;8(5):e63773.
- Sateia MJ et al. Clinical Practice Guideline for the Pharmacologic Treatment of Chronic Insomnia in Adults: An American Academy of Sleep Medicine Clinical Practice Guideline. J Clin Sleep Med. 2017;13(2):307-349.
- Herxheimer A, Petrie KJ. Melatonin for the prevention and treatment of jet lag. Cochrane Database Syst Rev. 2002(2):CD001520.
- Liira J et al. Pharmacological interventions for sleepiness and sleep disturbances caused by shift work. Cochrane Database Syst Rev. 2014;2014(8):CD009776.
- Erland LA, Saxena PK. Melatonin Natural Health Products and Supplements: Presence of Serotonin and Significant Variability of Melatonin Content. J Clin Sleep Med. 2017;13(2):275-281.
- Cohen PA et al. Quantity of Melatonin and CBD in Melatonin Gummies Sold in the US. JAMA. 2023;329(16):1401-1402.
- Lelak K et al. Pediatric Melatonin Ingestions - United States, 2012-2021. MMWR Morb Mortal Wkly Rep. 2022;71(22):725-729.
- Mah J, Pitre T. Oral magnesium supplementation for insomnia in older adults: a Systematic Review & Meta-Analysis. BMC Complement Med Ther. 2021;21(1):125.
- Arab A et al. The Role of Magnesium in Sleep Health: a Systematic Review of Available Literature. Biol Trace Elem Res. 2023;201(1):121-128.
- Rawji A et al. Examining the Effects of Supplemental Magnesium on Self-Reported Anxiety and Sleep Quality: A Systematic Review. Cureus. 2024;16(4):e59317.
- Van Laecke S. Hypomagnesemia and hypermagnesemia. Acta Clin Belg. 2019;74(1):41-47.
- Gröber U. Magnesium and Drugs. Int J Mol Sci. 2019;20(9).
- Edinger JD et al. Behavioral and psychological treatments for chronic insomnia disorder in adults: an American Academy of Sleep Medicine clinical practice guideline. J Clin Sleep Med. 2021;17(2):255-262.
- NHS. Melatonin: a medicine you can get on prescription only (UK).
- European Medicines Agency. Circadin (melatonin): prescription-only, for adults aged 55 and over.
- healthdirect Australia. Melatonin: over the counter in a slow-release form for people over 55; otherwise on prescription.
- US National Center for Complementary and Integrative Health. Melatonin: what you need to know.
General information based on the studies above, not medical advice. If sleep, tiredness or your health worries you, talk to a doctor.