Various studies have found that magnesium may have a range of benefits, including helping to improve sleep quality. Magnesium is a mineral naturally present in many foods and available as a supplement.

Although more research is necessary to determine how magnesium affects sleep quality, various studies have found the mineral positively impacts sleep.

Researchers believe magnesium may promote better sleep in various ways, such as reducing the stress hormone cortisol, increasing a sleep-promoting hormone called melatonin, and helping to regulate neurotransmitters for the central nervous system (CNS).

This article looks at how magnesium may affect sleep, other benefits, how to supplement with magnesium, and foods that contain the mineral. It also examines the risks of excessive magnesium intake and compares it with melatonin.


More research is necessary to determine how magnesium affects sleep. Researchers believe the mineral may promote better sleep in the following ways:

  • Regulating GABA in the CNS: Gamma-aminobutyric acid (GABA) is a neurotransmitter in the brain that calms the nervous system by stopping certain signals from transmitting. Magnesium may play a role in regulating GABA, which could help promote calm and act as a sedative, to promote sleep.
  • Relaxing muscles: Magnesium may also inhibit another neurotransmitter, called the N-methyl-D-aspartate receptor, which could promote muscle relaxation. This could help improve general relaxation and sleep.
  • Promoting melatonin: Studies have found that people deficient in magnesium also have decreased melatonin, a hormone that maintains the circadian rhythm. The circadian rhythm causes changes in the body according to the day-night cycle, such as feelings of sleepiness and wakefulness.
  • Decreasing cortisol: Cortisol is a stress hormone and contributes to functions such as the fight or flight response. A decrease in cortisol could promote calm and help improve sleep.