Magnesium for Leg Cramps: Does It Actually Work? What the Trials Show
For most older adults with night cramps, magnesium does no better than a placebo pill. Here is what the trials found, who might still try it, and what helps instead.

Magnesium for leg cramps is one of the most popular supplement uses there is, but for most adults with ordinary night cramps it probably doesn’t work. A 2020 Cochrane review, and an independent trial published since, found that magnesium does no better than a placebo pill for older adults with leg cramps. In pregnancy the evidence is mixed, and for restless legs it is too thin to judge.
What has better support is cheaper: stretching your calves and hamstrings before bed, possibly compression stockings, and a check with your doctor if cramps are frequent. Here’s what the trials found, and who might still try it.
Does magnesium help leg cramps? What the best trials found
The strongest summary is a 2020 Cochrane review of 11 randomized trials of magnesium for muscle cramps, with 735 people. Five tested people with ordinary cramps, mostly adults in their 60s with night-time leg cramps. The results were flat:
- After four weeks, people taking magnesium had about 0.18 fewer cramps per week than people on placebo, a tiny difference that wasn’t statistically significant (moderate-certainty evidence).
- The share of people whose cramps fell by a quarter or more was the same in both groups (high-certainty evidence).
- Cramp pain and how long cramps lasted didn’t improve either.
The reviewers concluded it is “unlikely that magnesium supplementation provides clinically meaningful cramp prophylaxis” (prevention) in older adults. They found no trials at all of magnesium for muscle cramps during exercise, so claims aimed at athletes haven’t been tested in trials.
Individual trials agree. In a 2017 trial in JAMA Internal Medicine, 94 adults with an average age of 65 took magnesium oxide or a look-alike placebo every night for four weeks. Cramps fell from about 7.8 to 4.4 a week on magnesium and from 8.5 to 5.5 on placebo, a non-significant difference. In a 2026 Finnish trial of 121 adults aged 50 to 85, 250 mg of magnesium a day for four weeks also did no better than placebo.
Who paid for these studies?
The 2017 trial was supported by Naveh Pharma, the company that made the capsules. The paper says the company had no role in the design, analysis or write-up, and the result was negative anyway. Of the Cochrane review’s 11 trials, two were funded by a magnesium tablet maker, three had independent funding and six didn’t say. The 2026 trial was paid for by an independent medical research foundation.
The only positive trial we found since that review was funded by the same company. In a 2021 study at seven sites in Ukraine, 184 adults took a magnesium oxide monohydrate capsule or a placebo every night for 60 days. Cramps fell by 3.4 a week on magnesium versus 2.6 on placebo, so just under one fewer cramp a week, and sleep improved more too. It was funded by a grant from Naveh Pharma and registered only after it had finished. It doesn’t outweigh the rest of the evidence, but you should know it exists.
Why it can feel like magnesium works
In the 2017 trial, cramps fell by more than a third on the placebo alone. The authors suggested this placebo effect may explain why magnesium is so widely used for cramps. There’s also a statistical trap: if you start a supplement during a bad run of cramps, a return to your usual level can look like the pill working.
What about magnesium for leg cramps in pregnancy?
Here the honest answer is “we don’t know yet.” The Cochrane review found five trials in pregnant women (408 in total). All five were judged at high risk of bias, their results conflicted, and they couldn’t be pooled into one estimate.
The most encouraging is a 2015 trial from Thailand, the only trial we found that tested magnesium glycinate for leg cramps. In it, 86 pregnant women with cramps at least twice a week were given 300 mg a day of magnesium bisglycinate or a placebo for four weeks. Cramps were at least halved in 86% of the magnesium group versus about 61% on placebo, intensity improved more, and nausea and diarrhea were no more common. It was university-funded, but small and registered only after it ended.
Magnesium might help some women, but the evidence is weak. Ask your prenatal care provider before taking any supplement. The 350 mg supplement limit covered below applies in pregnancy too.
Is magnesium glycinate better for leg cramps?
There’s no good evidence that it is. We searched PubMed and found no trial comparing magnesium forms head to head for cramps, and the one glycinate trial above compared it only with a placebo.
The NIH Office of Dietary Supplements says forms that dissolve well in liquid are absorbed better, and small studies show the aspartate, citrate, lactate and chloride forms are more bioavailable than oxide and sulfate. Glycinate isn’t part of that comparison, and no trial has shown that better absorption means fewer cramps.
Where the form does matter is your gut. The NIH lists magnesium carbonate, chloride, gluconate and oxide as the forms most often reported to cause diarrhea. For more, see our review of magnesium glycinate side effects, or watch our short video on magnesium glycinate.
So what’s the best magnesium for leg cramps? None has been shown to prevent typical night cramps. If you try one, pick a form you tolerate and judge it by your own cramp diary. If better sleep is your main goal, our guide to the best magnesium supplements for sleep compares products.
Does magnesium help restless legs or muscle twitching?
Restless legs syndrome (RLS) is not a cramp. A cramp is a muscle that suddenly tightens and hurts. RLS is an urge to move your legs, often with creeping, tugging or tingling feelings, that gets worse when you lie down at night and eases when you move.
The evidence on magnesium for restless legs is very limited. A 2019 systematic review found just eight relevant studies: one placebo-controlled trial, which showed no significant benefit (though it may have been too small), plus three case series and four single-patient reports. The reviewers couldn’t say whether magnesium helps. RLS may be more common in people who are short of iron, magnesium or folic acid, so a real deficiency is worth ruling out.
Unlike magnesium, iron has real evidence when tests show you need it. The American Academy of Sleep Medicine’s 2025 guideline says everyone with significant RLS should have their iron checked, including ferritin and transferrin saturation. Its consensus thresholds suggest iron treatment if ferritin is 75 ng/mL (75 µg/L) or lower, or transferrin saturation is under 20%. Its strongest recommendations are for IV iron and prescription drugs such as gabapentin and pregabalin. It also advises first tackling things that make RLS worse, such as alcohol, caffeine, some medicines and untreated sleep apnea. Magnesium is not among its recommended treatments. The academy funded the guideline; several authors, including the lead author, disclosed ties to companies developing RLS treatments, including research on IV iron.
The story is similar for magnesium for muscle twitching: we found no clinical trials testing it for everyday twitches. Low magnesium can cause muscle contractions and cramps, but the NIH says a symptomatic shortage is uncommon in healthy people. Your risk is higher if you have a gut condition such as Crohn’s or celiac disease, type 2 diabetes or alcohol dependence, or if you take loop or thiazide diuretics (water pills) or a proton pump inhibitor such as esomeprazole (Nexium) for more than a year. If that’s you, ask your doctor about a blood test.
What actually helps leg cramps at night?
Leg cramps at night are common and usually harmless: the NHS describes a sudden, painful tightening, often in the calf, lasting from a few seconds to 10 minutes, with soreness that can linger for up to 24 hours. Causes include ageing, overworked muscles, pregnancy, some medicines (such as statins and diuretics), not drinking enough fluids and alcohol-related liver disease. Sometimes there is no clear cause.
During a cramp: stretch and massage the muscle, or stand up and put your weight on the cramping leg.
Stretch before bed. In a 2012 Dutch trial of 80 adults over 55, those who stretched their calves and hamstrings every night just before sleep for six weeks saw their cramps drop by about 1.2 more per night than those who didn’t stretch, and their pain fell about 1.3 points more on a 10-point scale. It’s one small trial with no fake-stretch comparison, so expectation may explain part of it, but stretching is free and safe. The NHS suggests this calf stretch: face a wall, lean into it with your hands on the wall and feet flat until you feel your calves stretch, hold for 2 to 3 seconds, and repeat for 5 minutes, three times a day, with the last round just before bed. See our guide to static vs dynamic stretching for more.
Consider compression stockings. In the same 2026 Finnish trial where magnesium failed, knee-high medical compression stockings worn during the day for four weeks cut cramps by about 1.4 a week compared with placebo pills. The stockings group couldn’t be blinded, and four people stopped wearing them because of side effects. It’s a single trial, but promising. Ask a pharmacist about the right fit.
Drink enough, but don’t expect a cure. We found no randomized trials showing that extra fluids or electrolyte drinks prevent night cramps. Still, the NHS lists dehydration as one cause, so if you often run short, fix that. Learn the signs of dehydration, and use our free water intake calculator to get a daily target for your weight, activity and climate.
Skip quinine. Quinine, a malaria drug, is sometimes prescribed for night cramps. Its FDA-approved label (Qualaquin) carries a boxed warning: used for leg cramps, it can cause serious and life-threatening blood reactions, including low platelet counts and HUS/TTP, rare clotting disorders that have been linked to long-term kidney damage. The label says the risk outweighs any potential benefit, and it is not approved for cramps in the US. In the UK, a GP may still prescribe it if exercises haven’t helped, after discussing the risks.
| Option | What the evidence shows | Strength | Our verdict |
|---|---|---|---|
| Magnesium, older adults | No better than placebo overall; one small industry-funded trial positive | Moderate to high | Unlikely to help |
| Magnesium, pregnancy | Small trials conflict; one glycinate trial positive | Low | Uncertain; ask your provider |
| Stretching before bed | One trial of 80 adults: fewer, milder cramps | Low | Free and safe; try it first |
| Compression stockings | One 2026 trial: about 1.4 fewer cramps a week | Low | Promising; get the right fit |
| Quinine | FDA boxed warning: serious blood reactions | Strong safety warning | Avoid |
| Fluids and electrolytes | No trials for night cramps; dehydration is one cause | Very low | Fix if you’re short; not a cure |
| Iron (for RLS, not cramps) | Recommended by AASM 2025 when tests show low iron | Moderate | Test first, then treat |
Should you still try magnesium for leg cramps?
For most people with ordinary night cramps, magnesium is a long shot. A short trial may still be worth discussing with your doctor or pharmacist if:
- You’re pregnant and cramping, and your prenatal provider agrees.
- Your diet is low in magnesium, or you’re in one of the higher-risk groups above.
- You’ve stretched nightly for several weeks and still want to test something else.
If you go ahead, treat it as an experiment, not a habit:
- Count first. Keep a cramp diary for two weeks before you start, as the 2017 trial did, so you know your real starting point.
- Give it four weeks. The 2017, 2026 and 2015 pregnancy trials ran that long, and four weeks was the Cochrane review’s main time point.
- Stop if nothing clearly changes. Cramps eased on placebo too, so even an improvement may not be the magnesium.
- Keep stretching. It has better evidence and costs nothing.
Stay within the safety limits. The upper limit for magnesium from supplements is 350 mg a day for adults, including in pregnancy, unless your doctor advises otherwise. Food magnesium doesn’t count, because healthy kidneys clear the excess. Higher supplement doses often cause diarrhea, nausea and stomach cramps. If you have kidney disease, ask your doctor first: weaker kidneys clear magnesium less well, which raises the risk of toxic levels. Magnesium can also interfere with some medicines. Take tetracycline or quinolone antibiotics (such as doxycycline or ciprofloxacin) at least 2 hours before or 4 to 6 hours after it, and keep it at least 2 hours apart from osteoporosis drugs such as alendronate.
Food is the low-risk way to get more. Leafy greens, beans, nuts, seeds and whole grains are all good sources. The daily target is 400 to 420 mg for men and 310 to 320 mg for women, a little more in pregnancy. Our guide to magnesium after 40 covers how to get enough.
When should you see a doctor about leg cramps?
The NHS advises seeing a doctor if:
- Leg cramps are disturbing your sleep.
- You also have numbness or swelling in your legs.
- Cramps last longer than 10 minutes.
Also ask if cramps started after a new medicine, such as a statin or diuretic, but don’t stop a prescribed medicine on your own. And if what you feel is less a painful cramp and more an urge to keep moving your legs, ask about restless legs syndrome and an iron test.
The bottom line: magnesium is not the cramp fix it is marketed as, at least for older adults. Stretch before bed, consider compression stockings and get frequent cramps checked. For more free health calculators, browse all our tools.
This article is for general information and is not medical advice. Please read our medical disclaimer.
Wondering which form to try? Our guide to magnesium glycinate vs citrate compares absorption, side effects and best uses.
Sources
- Garrison SR, et al. Magnesium for skeletal muscle cramps. Cochrane Database Syst Rev. 2020;9(9):CD009402. PubMed 32956536
- Roguin Maor N, et al. Effect of magnesium oxide supplementation on nocturnal leg cramps: a randomized clinical trial. JAMA Intern Med. 2017;177(5):617-623. PubMed 28241153
- Kuusipalo A, et al. Secondary prevention of leg cramps using compression stockings or magnesium supplements: a three-arm randomized clinical trial. Trials. 2026;27(1):216. PubMed 41680812
- Barna O, et al. A randomized, double-blind, placebo-controlled, multicenter study assessing the efficacy of magnesium oxide monohydrate in the treatment of nocturnal leg cramps. Nutr J. 2021;20(1):90. PubMed 34719399
- Supakatisant C, Phupong V. Oral magnesium for relief in pregnancy-induced leg cramps: a randomised controlled trial. Matern Child Nutr. 2015;11(2):139-145. PubMed 22909270
- Hallegraeff JM, et al. Stretching before sleep reduces the frequency and severity of nocturnal leg cramps in older adults: a randomised trial. J Physiother. 2012;58(1):17-22. PubMed 22341378
- Marshall NS, et al. Magnesium supplementation for the treatment of restless legs syndrome and periodic limb movement disorder: a systematic review. Sleep Med Rev. 2019;48:101218. PubMed 31678660
- Winkelman JW, et al. Treatment of restless legs syndrome and periodic limb movement disorder: an American Academy of Sleep Medicine clinical practice guideline. J Clin Sleep Med. 2025;21(1):137-152. PubMed 39324694
- US Food and Drug Administration. Qualaquin (quinine sulfate) capsules: prescribing information, boxed warning. Revised June 2019. accessdata.fda.gov
- NIH Office of Dietary Supplements. Magnesium: Fact Sheet for Health Professionals. Updated January 2026. ods.od.nih.gov
- NHS. Leg cramps. Page last reviewed December 2023. nhs.uk
- MedlinePlus Medical Encyclopedia. Restless legs syndrome. US National Library of Medicine; reviewed July 2025. medlineplus.gov
This article is for informational purposes only and is not medical advice. See our Medical Disclaimer before changing your exercise, diet, or supplement routine.
See every method in action
New research-backed workouts on YouTube every week — no gym required.
Frequently asked questions
Is magnesium glycinate good for leg cramps?
There is no good evidence that it beats other forms. The only cramp trial using magnesium glycinate was in pregnant women, where 300 mg a day of magnesium bisglycinate helped more than a placebo, but the trial was small. No trial has compared glycinate with other forms for cramps, and for older adults with night cramps, magnesium in general has not done better than a placebo.
How much magnesium should I take for leg cramps?
We canu2019t give you a dose, because magnesium has not been shown to prevent ordinary night cramps in older adults. What we can give you is the safety ceiling: according to the NIH, the upper limit for magnesium from supplements is 350 mg a day for adults, including in pregnancy. Magnesium from food does not count toward it. If you have kidney disease, are pregnant or take regular medicines, talk to your doctor or pharmacist before you start.
Does magnesium help restless legs?
The evidence is too thin to say. A 2019 systematic review found only one placebo-controlled trial, which showed no significant benefit, plus a few case series and single-patient reports. The American Academy of Sleep Medicineu2019s 2025 guideline does not include magnesium among its recommended treatments. Its advice is to check iron levels, including ferritin, use iron when they are low, and cut back on things like alcohol and caffeine that make symptoms worse.
What is the best magnesium for leg cramps?
No form has been shown to prevent typical night cramps, so there is no proven best. If you decide to try one, pick a form your stomach tolerates. The NIH says the carbonate, chloride, gluconate and oxide forms are the ones most often reported to cause diarrhea. Keep a cramp diary and stop after four weeks if nothing clearly changes.
Why do I get leg cramps at night?
Sometimes there is no clear reason. The NHS lists ageing, overworked muscles, pregnancy, some medicines such as statins and diuretics, not drinking enough fluids and alcohol-related liver disease as possible causes. See a doctor if cramps disturb your sleep, last longer than 10 minutes, or come with numbness or swelling in your legs.
What works for leg cramps at night instead of magnesium?
Stretching your calves and hamstrings every night before bed cut cramps in a small trial of adults over 55, and it is free and safe. A 2026 trial found that knee-high compression stockings worn during the day reduced cramps by about 1.4 a week. Avoid quinine: the FDA warns it can cause serious, life-threatening blood reactions when used for leg cramps.
Is it safe to take magnesium for leg cramps in pregnancy?
Talk to your prenatal care provider first. Small trials of magnesium for pregnancy cramps have conflicting results, although one trial of magnesium bisglycinate found fewer and milder cramps than a placebo with no extra stomach side effects. The upper limit for magnesium from supplements is 350 mg a day in pregnancy, the same as for other adults.


