Magnesium calms the nervous system and relaxes the body, which is why lots of people find it helpful for sleep. Not all forms of magnesium work the same way in the body, so choosing the right one is important.

Written by: Stephanie Anderson Witmer
Written on: July 23, 2025
Medically reviewed by Jared Meacham, PhD, RD, CSCS and Patricia Weiser, PharmD
Has sleep turned into a bit of a nightmare? Been there. Work stress, kids’ schedules, endless to-do lists, and hormonal ups and downs can mess with our sleep in big ways. And when we don’t sleep well, we don’t do much of anything else well, either.
From calming teas and tart cherry juice to valerian, there are plenty of natural remedies that promise to help us drift off to dreamland—and stay there sleeping soundly until morning. If you’re familiar with these, you’ve probably heard about magnesium for sleep, too. It’s become a wildly popular pill to pop, with its promise of promoting better sleep.
But is magnesium actually a miracle mineral when it comes to sleep? Let’s dive into the science behind magnesium and sleep, what types are most effective, the possible benefits of taking magnesium, and why it could be the missing piece in your nighttime routine.
Magnesium plays a part in more than 300 biochemical processes in the body. It has a role in energy production, blood sugar control, immune system health, bone strength, muscle and nerve function, and blood pressure and heart rhythm regulation. Magnesium is also crucial for maintaining a healthy nervous system, making it especially relevant for sleep and stress, says Cara Shaw, nutritional therapist and nutrigenomics practitioner, DipCNM, mANP, mGNC.
In fact, magnesium and stress have what researchers describe as a bidirectional relationship. Studies suggest that a magnesium deficiency can make the body more susceptible to stress, plus stress can actually deplete your body’s magnesium stores.
Magnesium plays a critical role in the body’s stress response, serving as a regulator and inhibitor. Magnesium chills out the nervous system by boosting the role of the calming inhibitory neurotransmitter gamma-aminobutyric acid (GABA), while also toning down excitatory neurotransmitter glutamate (imagine magnesium lighting some candles, drawing a hot bath, and pouring a cup of chamomile tea for the body to quiet it down).
Magnesium also regulates the release of the body’s main stress hormone: cortisol. Cortisol gets a bad rap, but it is also important and necessary in the right amounts. When it’s unbalanced or levels are too high, what commonly results is low-quality sleep. Magnesium supplementation has been linked to lower cortisol levels, which may help calm the central nervous system and improve overall sleep quality, Shaw says.
Low magnesium levels can lead to overactivation of the hypothalamus-pituitary-adrenal (HPA) axis, which can make our response to stress feel more intense and last longer. Research across the UK, Europe, and the U.S. found many adults don’t get enough magnesium each day. In general, adult men need 300 mg of magnesium a day, and adult women need 270 mg a day.
Lots of people swear magnesium works like a dream for sleep. But how?
Magnesium’s role in the stress response plays a big part in sleep, Shaw explains. Its interactions with glutamate and GABA (which Shaw calls our “off switch” neurotransmitter) reduce nervous system excitability. It quiets brain activity so we can actually wind down at night to fall (and stay) asleep.

“It helps relax our muscles and calm the nervous system, which are essential ingredients for drifting off and staying asleep,” says Clarissa Lenherr, registered nutritionist and founder of Clarissa Lenherr Nutrition, mBANT, mCNHC, BANT.
Shaw says magnesium is often referred to as “nature’s tranquiliser” for its ability to relax muscles.
Magnesium is also involved in the production of melatonin — the sleep hormone that regulates our circadian rhythm (AKA our sleep/wake cycle). Animal studies suggest a link between magnesium deficiency and decrease in melatonin.
While it’s not as powerful as a sedative—and won’t be a magic bullet for everyone—research and clinical experience suggest magnesium does actually improve sleep quality by creating a calm bodily environment to develop better sleep patterns, both Shaw and Lenherr agree.
“Magnesium may improve the time taken to fall asleep more quickly, stay asleep longer, and have improved quality of sleep; particularly for those who suffer with mild insomnia or low magnesium levels,” Shaw says.
While the research into magnesium and sleep isn’t definitive, there are studies that back up Shaw’s’s assertion. A 2021 study in the journal Sleepfound magnesium was associated with better sleep quality and longer sleep.
Here’s how it helps:
Faster sleep onset: Magnesium can reduce sleep latency, or the time it takes to fall asleep, according to research into insomnia among older adults.
Deeper, uninterrupted sleep: It can increase slow-wave sleep, the most restorative stage of the sleep cycle.
Less nighttime anxiety: By calming the nervous system and regulating cortisol levels, magnesium can help quiet mental chatter and lessen anxiety so you can sleep.
Fewer muscle cramps: Magnesium may help relieve symptoms of restless leg syndrome, such as nighttime discomfort or leg movements that disturb sleep.
Better overall sleep quality: People taking magnesium have reported feeling more rested and alert upon waking.
Not all forms of magnesium are the same. Here are the differences—and the ones you should focus on for sleep:
Magnesium glycinate: If you’re looking for magnesium to help you sleep, both experts say magnesium glycinate is the one to get. In this form, magnesium is bound to glycine, an amino acid with its own calming properties and benefits for sleep. This form is highly bioavailable, gentle on the stomach, and has been studied for reducing anxiety and promoting restful sleep.
Magnesium L-threonate: Another good magnesium for sleep is magnesium l-threonate. It’s a more recently available formulation and can cross the blood-brain barrier, so it has benefits for cognitive function as well as sleep. “Research is still emerging, and it’s typically more expensive and harder to find,” Lenherr says.
Magnesium taurate: This form of magnesium is bound with the amino acid taurine, which also calms the nervous system and supports GABA, Shaw explains. “It’s another good option for sleep if stress or anxiety is an underlying issue,” she says.
Magnesium citrate: A popular, moderately bioavailable form that can support regularity and mild relaxation, magnesium citrate may also cause digestive issues in some people. It draws water into the intestines and can help with occasional constipation. “Magnesium citrate doesn’t offer the same calming properties as amino acid–bound forms, so it’s not my first choice for sleep support,” Lenherr says.
Magnesium oxide: Poorly absorbed and more likely to cause diarrhea, magnesium oxide isn’t commonly used for improving sleep. But it may help with other issues, such as relieving constipation or preventing migraines (with medical guidance).
Magnesium malate: Shaw says this type of magnesium is used more for energy and muscle pain, like for fibromyalgia, but it’s lacking evidence regarding its effectiveness with sleep.
Magnesium sulfate (Epsom salts): This form of magnesium is used topically in baths. Epsom salts may help promote relaxation (and the warm water probably helps), but it’s not a good option for sleep.
The strongest? Probably not. But it still might help you sleep better.
Magnesium works by targeting the root causes of sleep problems—anxiety, stress, muscle pain or tension, or circadian-rhythm disruption. “Magnesium supports the foundation for quality sleep, though its effects are gentler and more gradual compared to melatonin, which directly influences the body’s internal clocks,” Shaw says.
“Herbal remedies like valerian and chamomile may benefit some individuals, though research on their effectiveness is limited. What makes magnesium unique is its dual role in promoting physical relaxation and supporting balance within the nervous system.”

Magnesium is found naturally in many foods, including legumes, coffee, cocoa, fruit, nuts, spinach, and wholemeal bread. Magnesium from whole, minimally processed foods tends to be better absorbed. Cooking methods can deplete some magnesium content, especially boiling vegetables. Try steaming or sautéing instead.
If you’d like to get more magnesium from food, try these tidbits:

Magnesium supplements may be beneficial for anyone, Shaw says, particularly people who are under a lot of stress, those who have a poor diet, or really struggle with sleep.
It may also work for:
Adults with frequent nighttime muscle cramps or restless legs
Perimenopausal or menopausal women, for whom insomnia and sleep disruptions are common
People taking medications that deplete magnesium, such as proton pump inhibitors, antibiotics, or diuretics
People who’ve tried other sleep aids without success or who want a gentler natural option
Magnesium is generally safe when taken as directed, but there are a few things to know:
Start low: Too much too fast can cause diarrhea or stomach discomfort. Lenherr says a common sleep dosage is between 200 mg and 400 mg per day. But some people may find improvement in their sleep with as little as 100 mg, Shaw says. Start on the low end and gradually increase, if needed.
Stick to reputable brands: Purity and dosage accuracy matter. See Healf’s supplement recommendations.
Talk to your GP first: Before starting magnesium (or any supplement), it’s best to speak with your GP first, especially if you take other medications, have impaired kidney function, or are pregnant, Lenherr says.
Want to get the most from your magnesium supplement? Use it strategically:
Take it 30 minutes to 2 hours before bed, the experts recommend. This gives your body time to absorb it and start calming the nervous system. “Take it after dinner to support the natural wind-down process,” Shaw says. “Magnesium is best absorbed with proteins and carbohydrates.”
Create a calming bedtime ritual. Incorporate magnesium into a wind-down routine. Think: Yes to a warm bath and book, no to doom-scrolling on TikTok. “Magnesium isn’t a one-fix solution,” Lenherr says. “It’s important to also do the groundwork for sleep, such as implementing good sleep hygiene practices and stress-management techniques.”
Be consistent. Magnesium won’t fix your sleep after one night of use. It may take a week or two to notice an impact.
Does magnesium really help you sleep better? Yes, if it’s the right kind and part of a bigger sleep strategy. Magnesium isn’t a sedative sleep aid but it can serve as a powerful and natural relaxation tool that supports your brain, body, and nervous system.
Magnesium promotes sleep by calming the nervous system, supporting your body’s natural melatonin production, regulating cortisol, and easing muscle tension.
Magnesium glycinate, magnesium L-threonate, and magnesium taurate are the top choices for sleep.
Take it 30 minutes to 2 hours before bed as part of a consistent nighttime routine.
Side effects are rare but possible. Check with your GP first, and start on a low dose to allow your body time to adjust.
Yes, magnesium may help promote better sleep by calming the nervous system and relaxing muscles. Magnesium also supports melatonin production and cortisol regulation—two hormones that are vital for getting a good night’s rest.
Certain types of magnesium may promote better sleep. These are magnesium glycinate, magnesium L-threonate, and magnesium taurate. Other forms of magnesium have other benefits, but they’re not as effective for sleep.
Magnesium is generally considered to be safe to take on a nightly basis, but check with your GP before taking any supplements to ensure they’re a safe fit for you and won’t interact with any other medications or supplements you may be taking.
Signs you may have low magnesium are fatigue, muscle weakness, muscle cramps or spasms, numbness, involuntary eye movements (called nystagmus), or convulsions. Your GP can order a blood test to check your magnesium level.
This article is for informational purposes only, even if and regardless of whether it features the advice of physicians and medical practitioners. This article is not, nor is it intended to be, a substitute for professional medical advice, diagnosis, or treatment and should never be relied upon for specific medical advice. The views expressed in this article are the views of the expert and do not necessarily represent the views of Healf
This article is for informational purposes only, even if and regardless of whether it features the advice of physicians and medical practitioners. This article is not, nor is it intended to be, a substitute for professional medical advice, diagnosis, or treatment and should never be relied upon for specific medical advice. The views expressed in this article are the views of the expert and do not necessarily represent the views of Healf
Stephanie Anderson Witmer is a freelance health journalist and content writer with nearly 30 years of experience. Her work has been published in top magazines and digital publications, including Prevention, Good Housekeeping, Health, Women's Health, USA Today, Yoga Journal, Parade, and Today's Parent. She's created content for brands, including Hone Health, GoodRx, Weight Watchers, WebMD, CVS Health, UPMC, and others.