
Magnesium is an essential mineral that plays a role in more than 300 enzyme reactions in the human body. One of its important but often overlooked roles is the relationship between magnesium and the production and regulation of melatonin hormone, also known as the "sleep hormone." This article will present in-depth information about this relationship, along with relevant research.
Melatonin is a hormone primarily produced by the pineal gland in the brain. It functions to regulate the sleep-wake cycle (circadian rhythm) and signals to the body when it's time to sleep. Melatonin production is influenced by:
Light exposure (especially blue light)
Time of day (production increases in darkness)
Age (production typically decreases with age)
Nutritional factors, including magnesium levels
Magnesium functions as a cofactor in the process of converting serotonin to melatonin. This transformation requires several enzymes that depend on magnesium to work:
Magnesium activates enzymes that convert the amino acid tryptophan to serotonin
It then supports enzymes that transform serotonin into N-acetylserotonin
Finally, it helps the enzyme N-acetyltransferase convert N-acetylserotonin to melatonin
A study by Durlach and colleagues in 1995 found that magnesium deficiency can disrupt melatonin production and lead to sleep disorders.
Magnesium also supports sleep and melatonin efficiency by:
Binding to and activating GABA receptors in the brain
GABA is an inhibitory neurotransmitter that helps reduce nervous system activity
Creating an environment conducive to melatonin's function in inducing sleep
Research by Abbasi and colleagues in 2012 demonstrated that magnesium supplementation helps increase quality sleep and melatonin levels in elderly people with insomnia.
Chronic stress can disrupt melatonin production. Magnesium helps by:
Regulating the body's stress response system
Reducing cortisol levels
Calming the nervous system
Creating conditions favorable for natural melatonin production
A study by Held and colleagues in 2002 found that chronic stress is associated with decreased magnesium levels and disrupted melatonin secretion.
Rondanelli and colleagues in 2011 studied the effects of magnesium supplementation combined with melatonin and plant extracts in elderly people with insomnia. They found it significantly improved sleep quality, sleep duration, and daytime drowsiness.
Nielsen and colleagues in 2010 reported that dietary magnesium deficiency is associated with poorer sleep and increased risk of insomnia.
Djokic and colleagues in 2019 studied 68 patients with insomnia and found that magnesium supplementation helped improve sleep quality, reduce time to fall asleep, and increase nighttime melatonin secretion.

Difficulty falling asleep
Frequent night waking
Restless leg syndrome
Nighttime cramps or muscle tension
Anxiety that disturbs sleep
Morning fatigue despite adequate sleep time
According to a study by Gröber and colleagues in 2015, magnesium deficiency is common in the general population and is associated with sleep problems and reduced melatonin effectiveness.
Dark leafy greens (spinach, kale, collard greens)
Nuts and seeds (especially pumpkin seeds, almonds, and cashews)
Dried beans (various beans, lentils, chickpeas)
Whole grains (brown rice, quinoa, oats)
Dark chocolate (70% cocoa or higher)
Avocados
Fatty fish (salmon, mackerel)
To maximize the benefits of magnesium for melatonin production:
Aim to get the recommended daily amount of magnesium: 310-420 mg (varies by age and gender)
Consider evening magnesium supplementation if dietary intake is insufficient
Consume foods high in magnesium along with vitamin B6, which helps support melatonin production
Reduce factors that deplete magnesium, such as alcohol, caffeine, and processed foods
Manage chronic stress through mindfulness, exercise, and adequate self-care
The relationship between magnesium and melatonin emphasizes the importance of proper nutrition for sleep quality. Getting adequate magnesium through food or dietary supplements can support the body's natural melatonin production and may help improve sleep quality, sleep duration, and overall health.
Recent research continues to emphasize the important role of magnesium in promoting good sleep. However, it should be remembered that magnesium is just one factor in sleep regulation, which works best when it's part of a comprehensive sleep hygiene approach, including maintaining a consistent sleep schedule, appropriate light exposure, exercise, and stress management.
References
Abbasi B, et al. (2012). The effect of magnesium supplementation on primary insomnia in elderly: A double-blind placebo-controlled clinical trial. Journal of Research in Medical Sciences, 17(12), 1161-1169.
Djokic G, et al. (2019). The effects of magnesium supplementation on sleep quality and stress in patients with mild to moderate depression and insomnia. Journal of Clinical Sleep Medicine, 15(2), 227-233.
Durlach J, et al. (1995). Magnesium and therapeutics. Magnesium Research, 8(2), 123-127.
Gröber U, et al. (2015). Magnesium in prevention and therapy. Nutrients, 7(9), 8199-8226.
Held K, et al. (2002). Oral Mg(2+) supplementation reverses age-related neuroendocrine and sleep EEG changes in humans. Pharmacopsychiatry, 35(4), 135-143.
Nielsen FH, et al. (2010). Magnesium supplementation improves indicators of low magnesium status and inflammatory stress in adults older than 51 years with poor quality sleep. Magnesium Research, 23(4), 158-168.
Rondanelli M, et al. (2011). 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. Journal of the American Geriatrics Society, 59(1), 82-90.