Leg cramps can be painful at any time of day or night, but nocturnal leg cramps come with the added pain of losing out on sleep. If you have them, you’re not alone, up to 60% of us have had nocturnal leg cramps.
Magnesium supplements may help, but the science is mixed.
Below, we dive into what we know about magnesium for leg cramps at night. Plus, we cover how the RISE app can help you fall and stay asleep while you’re treating your leg cramps — and beyond.
It’s unclear if magnesium can help leg cramps at night. Some studies show that it can, but other studies show that it can’t. Studies on magnesium and leg cramps are often done on certain populations — like pregnant women or older adults — so it’s unclear if magnesium can help the general population with leg cramps.
Plus, studies have conflicting results, are small, and use different doses and types of magnesium — including oral magnesium and intravenous infusions — making it hard to draw any solid conclusions.
Many studies also don’t check participants’ baseline levels of magnesium, so we don’t know if having a magnesium deficiency makes a difference.
Whether magnesium can help you may depend on:
Here’s a round-up of some of the research.
A 2021 study had 175 participants take 226 milligrams (mg) of magnesium oxide monohydrate or a placebo daily for 60 days.
Both groups saw a reduction in the number of nocturnal leg cramp episodes they had, but the magnesium group saw a larger reduction.
The magnesium group also saw a greater reduction in leg cramp duration and an improvement in sleep quality.
A 2012 study looked at 80 pregnant women with leg cramps. About half took 300 mg of magnesium bisglycinate chelate daily for four weeks and the other half took a placebo.
More people in the magnesium group had a 50% reduction in leg cramp frequency and a 50% reduction in cramp intensity compared to the placebo group.
A 2014 systematic review and meta-analysis looked at seven studies including 361 people in total. It concluded that magnesium doesn’t appear to help nocturnal leg cramps in the general population, but it may have “a small effect in pregnant women.”
A 2020 review looked at 11 randomized controlled trials on magnesium and skeletal muscle cramps including more than 700 participants in total. It concluded that magnesium was unlikely to reduce cramps in older adults, people with liver cirrhosis (liver scarring), and in some pregnant women.
An older study from 1999 looked at 42 participants with nocturnal leg cramps. Participants took 900 mg of magnesium citrate twice a day for a month and then a placebo for a month, or vice versa.
Participants’ leg cramps improved over time regardless of the treatment they received. The researchers said this was due to a combination of the placebo effect and cramps naturally getting better over time.
Newer research has similar findings.
In a 2017 study, 88 older adults took either 865 mg of magnesium oxide or a placebo daily for four weeks. At the end of the experiment, there was no difference between the magnesium group and the placebo group.
Leg cramps slightly improved in both groups, but the researchers said the beneficial effect of magnesium could be due to the placebo effect again.
As with everything magnesium, more research is needed. But magnesium supplements may help you get better sleep in general or improve medical conditions or sleep disorders that disrupt your sleep.
Magnesium may help people with:
We’ve covered how magnesium can make you tired and sleepy here.
Heads-up: Nocturnal leg cramps and restless leg syndrome are similar conditions, but they’re not quite the same.
Magnesium may help RLS. We’ve covered more on magnesium for restless leg syndrome here.
{{ cta }}
There isn’t a recommended amount of magnesium to take for leg cramps at night as it’s unclear if magnesium can help reduce leg cramps.
For sleep in general, Dr. Wu recommends:
Start with a low dose and slowly increase if needed and if you’re not experiencing any side effects.
In research on leg cramps, the amount of magnesium taken can be high, but this can’t be taken as a guideline for the general public. Studies are done in controlled environments, under medical supervision, and may use high doses to find out how effective they could be.
We’ve covered how much magnesium to take for sleep in general here, including how much to take for depression, anxiety, menopause, and exercise performance.
There isn’t a recommended time to take magnesium for leg cramps at night as more research is needed to find out if magnesium can help — let alone what time would be best.
In general, Dr. Wu recommends taking magnesium 30 minutes to one hour before bed. But timing may not be that important, so you can take them earlier if you prefer.
We’ve covered when to take magnesium for sleep here.
Instead of timing, it may be more important to remember to take magnesium every day.
To help, RISE can send you a reminder when it’s time to start your bedtime routine, which can include taking magnesium. You can get this reminder on your phone, iPad, or Apple Watch and customize when you’ll get it exactly.
If magnesium helps with leg cramps at night, it's thought to be because magnesium plays a role in nerve and muscle function, aiding in muscle contraction and relaxation. Magnesium also helps transport electrolytes — like calcium and potassium — into your cells. Low magnesium could cause an electrolyte imbalance, which can cause muscle cramps.
Not everyone agrees electrolyte imbalances or low magnesium can lead to nocturnal leg cramps, though. But low magnesium may play a role for some people.
For example, a 2009 clinical trial found that low magnesium levels were associated with leg cramps in pregnant women.
Therefore, magnesium supplements could help those with leg cramps caused by low magnesium levels. This could be many of us — nearly 50% of Americans don’t get enough magnesium from food.
More research is needed, though. Leg cramps aren’t always caused by low magnesium levels. And even if yours are, it’s not clear if increasing your magnesium intake from food could help or if supplements are best.
FYI, foods high in magnesium include:
Looking for a sleep supplement? We’ve compared magnesium vs. melatonin here.
{{ cta-mini }}
Magnesium may help treat leg cramps at night, but there are other treatment options you can try alongside or instead of magnesium supplements.
Here’s what could help:
FYI, quinine is no longer recommended as a treatment for leg cramps as it can cause serious adverse effects, including death. The FDA has ordered quinine not to be marketed as a leg cramp treatment.
Expert tip: If you experience leg cramps, you want to make sure nothing else disrupts your sleep and the sleep you get is the best it can be. Improving your sleep hygiene is key.
Sleep hygiene is the name for the habits that help you fall and stay asleep. They include:
RISE can tell you the best time to do 20+ sleep hygiene habits based on your circadian rhythm, or body clock. This makes them even more effective.
Improving your sleep hygiene can help you meet your sleep need — the amount of sleep you personally need. RISE can tell you how much sleep to aim for as it’s not a simple eight hours for everyone.
For example, among 1.95 million RISE users aged 24 and up, sleep needs ranged from five hours to a whopping 11 hours 30 minutes.
RISE users on iOS 1.202 and above can view their sleep need here and set up their 20+ in-app habit notifications here.
Magnesium supplements may reduce leg cramps at night, but they’re not guaranteed to work for everyone. They may help if you’re pregnant, but get medical advice to make sure they’re safe for you.
To get the best sleep possible — even with leg cramps — focus on improving your sleep hygiene. RISE can tell you the best time to do 20+ sleep hygiene habits to help you fall and stay asleep.
User says these reminders have improved their nights and days:
“Just becoming more aware of when’s the best time to drink caffeine, eat dinner, and get sunlight according to my circadian rhythm has helped my sleep quality tremendously…I now sleep better than ever and feel so much more productive throughout the day.” Read the review.
And it doesn’t take long — 80% of RISE users get better sleep within five days.
Learn more about Rise for sales teams.
RISE makes it easy to improve your sleep and daily energy to reach your potential