Leg cramps are one of the most common reasons people reach for magnesium supplements. The logic seems obvious — magnesium is essential for muscle function, deficiency can cause muscle spasms, so supplementing should help.
The reality is more complicated. Here’s what the clinical evidence actually shows, and where magnesium may still be worth trying.
Why Magnesium Is Linked to Leg Cramps
Magnesium plays a direct role in muscle contraction and relaxation. It regulates calcium movement across cell membranes — calcium triggers muscle contraction, magnesium facilitates relaxation. It also inhibits acetylcholine release at the neuromuscular junction, reducing the nerve signals that cause muscles to fire involuntarily.
When magnesium levels are low, muscles become more excitable and harder to relax. This is the biological basis for the belief that magnesium supplements may reduce cramping.
The problem is that a plausible mechanism doesn’t automatically translate to a proven clinical benefit — especially when leg cramps have multiple causes, only some of which involve magnesium.
What Does the Research Show?
The honest answer: for most people, the evidence is weak.
The most rigorous analysis to date is the Cochrane systematic review (updated 2020), which pooled data from 11 randomised controlled trials involving 735 participants. The conclusion was that magnesium supplementation is unlikely to provide clinically meaningful benefit for older adults experiencing idiopathic (no known cause) nocturnal leg cramps.
A 2021 double-blind, placebo-controlled trial published in Nutrition Journal tested magnesium oxide monohydrate (226mg daily) in 173 participants over 60 days. Both the magnesium and placebo groups improved significantly — but there was no meaningful difference between them, suggesting a strong placebo effect rather than a genuine treatment benefit.
A 2017 randomised trial published in JAMA Internal Medicine reached the same conclusion: magnesium oxide was no better than placebo for reducing nocturnal leg cramps in adults aged 60 and older.
Where there’s more signal: pregnancy-associated leg cramps. Some studies have found a modest benefit here, though the Cochrane review notes the evidence is conflicting and the trials had significant methodological limitations. If you’re pregnant and experiencing leg cramps, it’s worth discussing magnesium with your midwife or GP — the safety profile is good and it may help.
When Magnesium Might Still Be Worth Trying
The null results above mostly concern people taking magnesium when their baseline levels are unknown. There’s a meaningful distinction between:
Cramps caused by low magnesium levels — if you’re deficient, correcting that deficiency may genuinely help. The Cochrane reviewers note this caveat explicitly: the studies don’t rule out benefit in people who are actually deficient.
Cramps not caused by low magnesium — supplementing here is less likely to make a difference, which may explain why the trials show weak results in unselected populations.
Magnesium deficiency is more common than most people realise, particularly in UK adults over 40. Factors that deplete magnesium include alcohol consumption, long-term use of proton pump inhibitors (PPIs like omeprazole), type 2 diabetes, and high-intensity exercise. If several of these apply to you, your baseline magnesium levels may already be low — and that changes the calculus somewhat.
Other symptoms of low magnesium include persistent fatigue, poor sleep quality, muscle twitching or weakness, and heightened anxiety. If leg cramps are accompanied by several of these, a magnesium shortfall is a more plausible factor. See our guide to magnesium benefits for the broader picture on deficiency.
What Actually Causes Leg Cramps
Understanding the full picture helps set realistic expectations for any supplement.
Dehydration and electrolyte imbalance. One of the most common contributors, particularly at night and after exercise. Magnesium is an electrolyte, but so are sodium, potassium, and calcium — all of which affect muscle function. Drinking more water and ensuring good overall electrolyte intake is a sensible first step.
Sedentary lifestyle and reduced flexibility. Prolonged sitting shortens tendons and reduces the range of motion in calf muscles, making them more prone to cramping. Regular movement and calf stretching before bed have reasonable evidence behind them.
Sleep position. Sleeping face-down puts the foot in plantar flexion (toes pointed), which shortens the calf muscle. Even minor movements can trigger a cramp in this position. Sleeping on your side or back with feet in a neutral position may reduce frequency.
Ageing. Nocturnal leg cramps become more common from the mid-50s onward as motor neurons are gradually lost. Around one in three adults over 60 experience them at least monthly.
Medications. Diuretics, statins, and some asthma medications are linked to increased cramping. If you started experiencing cramps after beginning a new medication, it’s worth discussing this with your GP.
Exercise overload. Skeletal muscle fatigue from overexertion causes localised cramping in overworked fibres. Hydration helps, but there’s no proven way to fully prevent exercise-induced cramps.
If You Do Want to Try Magnesium
Given the reasonable safety profile and the possibility that deficiency is a contributing factor, trying magnesium is a low-risk decision. A few practical points:
Choose an absorbable form. Most trials that showed no benefit used magnesium oxide — which has notoriously poor absorption. If you’re going to try magnesium, magnesium glycinate or magnesium citrate are significantly better absorbed. See our guide to magnesium glycinate vs citrate for a comparison.
Give it enough time. The one trial that showed any positive signal used 60 days of supplementation. Short courses of 4 weeks appear insufficient. If you’re assessing whether magnesium helps your cramps, commit to at least 6–8 weeks of consistent use.
Don’t rely on it alone. Address other likely causes simultaneously: hydration, calf stretching before bed, sleep position, and — if relevant — review your medications with your GP.
Dosage: The NHS recommends 270mg/day for women and 300mg/day for men. The EU’s tolerable upper level for supplemental magnesium is 250mg/day from supplements.
When to See a GP
Occasional leg cramps are usually harmless. Speak to your GP if:
- Cramps are frequent, severe, or waking you most nights
- They’re accompanied by significant swelling, redness, or skin changes
- Muscle weakness persists after cramping
- You’ve recently started a new medication and cramps began around the same time
Frequent cramps can occasionally indicate conditions such as peripheral arterial disease, nerve compression, or kidney disease — all of which require investigation rather than supplementation.
FAQ
Q: Does magnesium help with leg cramps?
A: The clinical evidence is mixed. Large reviews of randomised trials have not found significant benefit for the general population or older adults. The exception may be people who are magnesium deficient, or those experiencing pregnancy-related cramps. If you suspect low magnesium is a factor, it’s a reasonable supplement to try — particularly in a well-absorbed form like glycinate, and for at least 6–8 weeks.
Q: Why do I get leg cramps at night?
A: Nocturnal leg cramps have several causes: dehydration, sleep position (particularly lying face-down), reduced flexibility from prolonged sitting, ageing, and some medications. Magnesium deficiency is one possible contributing factor but not the only one.
Q: What is the best magnesium for leg cramps?
A: Most trials that showed no benefit used magnesium oxide, which has poor bioavailability. If trying magnesium for cramps, a better-absorbed form like magnesium glycinate or citrate is preferable. Magnesium glycinate is the gentler option for daily use.
Q: How long does magnesium take to work for leg cramps?
A: The one trial showing a positive signal ran for 60 days. Short courses of 2–4 weeks appear to produce results no better than placebo. If assessing whether magnesium helps your cramps, give it at least 6–8 weeks of consistent supplementation.
Q: Can dehydration cause leg cramps?
A: Yes — dehydration and electrolyte imbalance are among the most common causes of nocturnal leg cramps. Increasing water intake throughout the day, particularly if you exercise or sweat heavily, is one of the most straightforward interventions to try alongside any supplementation.
References
- Garrison SR, et al. (2020). Magnesium for skeletal muscle cramps. Cochrane Database of Systematic Reviews, Issue 9.
- Maor NR, et al. (2017). Effect of magnesium oxide supplementation on nocturnal leg cramps. JAMA Internal Medicine, 177(5), 617–623.
- Roguin Maor N, et al. (2021). Magnesium oxide monohydrate in the treatment of nocturnal leg cramps. Nutrition Journal, 20(1), 90.
- NHS. Leg cramps.
- NHS. Vitamins and minerals — Magnesium.
This article is for informational purposes only and does not constitute medical advice. Always consult a qualified healthcare professional before starting any supplement, especially if you are pregnant, have a medical condition, or take prescription medication.


