In short: Magnesium contributes to normal muscle function. When it comes to cramps, it helps above all when magnesium is lacking, and in studies also in pregnancy. If cramps keep coming back despite magnesium, the amount, form or how long you've taken it is often the reason. Many calf cramps have other triggers, such as tired muscles or medicines. Then evening stretching and compression socks help.
Key points
- Magnesium and muscles: Magnesium contributes to normal muscle function. A deficiency can trigger muscle cramps.
- Where studies show a benefit: calf cramps in pregnancy, and in a study of 175 adults with night-time cramps.
- Common reasons for cramps despite magnesium: taken for too short a time, too little or poorly absorbed, or the cramp has a different cause.
- What else helps: stretch your calves and hamstrings every evening. Compression socks also helped in studies.
- Get it checked: if cramps come very often, start after a new medicine, or your leg is swollen, red or warm.
Contents
- Does magnesium help against cramps?
- Cramps despite magnesium: what could be the reason?
- What helps with calf cramps besides magnesium?
- Calf cramps at night despite magnesium: what's behind it?
- Which magnesium for calf cramps?
- When should you get cramps checked by a doctor?
- Frequently asked questions
- Limits of the research and all sources
Does magnesium help against cramps?
Magnesium is a basic building block for muscles. Magnesium contributes to normal muscle function. Magnesium contributes to electrolyte balance. When the body lacks it, muscle cramps are one of the typical consequences. If your supply is on the low side, you have good reasons to improve it.
A second area with positive studies is calf cramps in pregnancy. There's also a larger study of adults who had cramps at night.
What the studies show: Review articles list muscle cramps as one consequence of a magnesium deficiency.1 In a study of 86 pregnant women, cramps halved in 86% of women taking magnesium bisglycinate, compared with 61% on placebo.2 In a Swedish study of 73 pregnant women too, symptoms eased more with magnesium than with placebo.3 An analysis of four studies with around 364 pregnant women also found less frequent cramps with magnesium.4 In a study of 175 adults with night-time calf cramps, cramps fell more with magnesium than with placebo. They became shorter, and participants slept better.5
In a Swiss observational study of 129 GP patients over 50 with night-time cramps, one in four took magnesium. Those who took it had fewer cramps per day on average.6
Our take: magnesium is a sensible first step for cramps if your supply might be on the low side, or if you're pregnant (then after checking with your doctor or midwife). Give it four to six weeks in a well-absorbed form and combine it with evening stretching. If nothing has changed by then, your cramp probably has a different trigger. How well magnesium helps against cramps without a deficiency still needs to be clarified by further studies (more under "Limits of the research").
More on calf cramps in pregnancy is in Magnesium in pregnancy.
Cramps despite magnesium: what could be the reason?
Whether in your calves, feet or other muscles: if muscle cramps continue despite magnesium, there are two possibilities. Either the magnesium isn't getting through the way it should. Or the cramp has little to do with magnesium. The table helps you narrow it down.
| Possible reason | What's behind it | What you can do |
|---|---|---|
| Taken for too short a time | Your magnesium level rises over weeks | stick with it for at least four weeks |
| Too little, or all at once | the gut absorbs proportionally less from large portions | split the daily amount across two meals |
| Poorly absorbed form | magnesium oxide is absorbed less well than organic forms | choose citrate or bisglycinate |
| Ongoing loss | e.g. from stomach-protecting acid blockers (proton pump inhibitors), diuretics, alcohol | get the cause checked by a doctor |
| Cramp without a deficiency | muscle and nerve are overstimulated, often from fatigue | stretch, adjust your activity level |
| Medicines | some can promote cramps | go through your medication list with your doctor |
| Illnesses | e.g. poor circulation in the legs, joint disease | get it checked by a doctor |
Duration and amount: Magnesium doesn't work overnight. Your blood magnesium level rises with the amount and the length of time you take it, reaching a stable level after around 20 weeks.7 The studies with a positive result ran for three weeks to two months.2, 3, 5 Up to 250 mg of magnesium a day from supplements is considered safe.8
Form: Organic forms such as citrate or glycinate are absorbed better than inorganic ones such as oxide. The larger the portion, the smaller the share that's absorbed.9
Cramp without a deficiency: For many cramps, magnesium balance plays hardly any role. Night-time calf cramps are thought to arise mainly from a fatigued muscle and disrupted nerve control, rather than from a lack of salts.10 For cramps during exercise, overload and muscle fatigue are considered the main trigger, rather than a lack of salts or fluid.11
Medicines: In data from 4.2 million residents of the Canadian province of British Columbia, people aged 50 and over were more often prescribed an anti-cramp medicine after starting certain medications. This was clearest for long-acting asthma inhalers (so-called beta-2 agonists), and for potassium-sparing and thiazide diuretics. For statins, the link was small.12 How medicines can also disrupt magnesium balance itself is covered in Magnesium deficiency: causes.
Illnesses: In a survey of 365 people aged 65 and over, half had leg cramps. They occurred more often with poor circulation in the legs, joint disease and in women.13 Review articles also mention narrowing of the spinal canal in the lower back, liver cirrhosis and dialysis.10
If you suspect a medicine, don't stop it on your own. Talk to your doctor, there's often an alternative or a different dose.
What helps with calf cramps besides magnesium?
The strongest case is for evening stretching, and it costs nothing. Compression socks and a few tricks for an acute cramp come next.
How to do it:
- Stretch your calf: Stand facing a wall with both hands on it. Step one leg back, heel on the floor, knee straight. Hold the stretch for a few calm breaths, then switch sides.
- Stretch your hamstring: Sit on the edge of the bed, stretch one leg out in front of you and lean forward gently with a straight back until you feel a pull.
- Every evening, right before bed, over several weeks.
- During an acute cramp: pull your toes towards you, or stand up and press your heel firmly into the floor. Then gently massage the calf.
What the studies show: In a study of 80 people over 55, participants stretched their calves and hamstrings every evening for six weeks. Afterwards, they had just over one cramp fewer per night than the comparison group, and the cramps were less painful.14 In a Finnish study of 121 people aged 50 to 85, knee-high compression socks helped. The number of cramps fell from a typical four to two per week. Participants woke up less often at night and had less pain.15
An old home remedy is pickle juice. In a laboratory trial with artificially triggered cramps, they ended around 49 seconds sooner after a sip of pickle juice than after water. The researchers suspect a reflex from the mouth and throat that relaxes the muscle.16

Calf cramps at night despite magnesium: what's behind it?
Night-time calf cramps are very common and become more frequent with age. Usually there's no illness behind them. Typical is a sudden, very painful cramp in the calf or foot that lasts seconds to a few minutes and jolts you out of sleep. Afterwards, the muscle can still ache for a while.
This should be distinguished from restless legs syndrome. There, your legs tingle or pull when at rest, and you need to move them. A hard, painful muscle isn't part of it.
What the studies show: In a large US survey, a quarter of adults reported mild night-time leg cramps, and 6% moderate to severe ones.17 Among people aged 65 and over, one in two had leg cramps, most of them at night.13 A systematic review describes night-time calf cramps as a severe pain in the calf or foot that lasts seconds up to ten minutes at most and disrupts sleep.18 Most are probably triggered when the foot is stretched while lying down, meaning the toes point downward.19
Tip: If you sleep on your back, a tucked-in duvet often pushes your feet down. Leave some slack in the duvet at the foot end, or put a pillow under it. If you sleep on your front, you can let your feet hang over the edge of the mattress. This keeps the calf in a more relaxed position.
If you take magnesium against night-time cramps, taking it with your evening meal works well. In the study of 175 participants, it was taken in the evening before bed.5 When magnesium otherwise suits you best is covered in When should you take magnesium?
Which magnesium for calf cramps?
Best is a well-absorbed organic form such as magnesium citrate or magnesium bisglycinate. Bisglycinate is considered especially gentle on the stomach, which helps if you're taking it daily over weeks.
What the studies show: Organic forms are absorbed better than inorganic ones.9 The pregnancy study with the clearest result used 300 mg of magnesium bisglycinate a day.2 The positive study on night-time cramps used a special form of magnesium oxide.5
| Question | Our recommendation |
|---|---|
| Which form? | citrate or bisglycinate |
| How much? | up to 250 mg of magnesium a day from supplements; in pregnancy, after checking with your doctor |
| When? | with meals; for night-time cramps, one dose with your evening meal |
| How long to try it? | four to six weeks, then take stock |
You'll find all the forms compared in Which magnesium is best? How much you need overall is covered in How much magnesium per day?
When should you get cramps checked by a doctor?
Occasional calf cramps are harmless. If they pull you out of sleep often, get them checked by a doctor. The same applies if they persist for weeks despite magnesium and stretching, or if other symptoms appear.
Important: See a doctor soon if
- a leg is swollen, red or warm,
- your calf hurts when walking and eases at rest,
- muscle weakness, numbness or muscle twitching appear as well,
- the cramps started after a new medicine,
- you have kidney disease and want to take magnesium. In that case, magnesium can build up in the body.20
At the appointment, magnesium, potassium, calcium and kidney values can be measured in your blood. What a magnesium deficiency is and how it's diagnosed is covered in Magnesium deficiency: symptoms, causes and what you can do. Anti-cramp medicines such as quinine are only available on prescription. Because of rare but serious side effects, they're only considered for severe symptoms and after a doctor's assessment.21
Frequently asked questions
How quickly does magnesium help against cramps? Expect weeks, not days. The studies with a positive result ran for three weeks to two months.2, 3, 5 Your blood magnesium level rises over weeks and is stable after around 20 weeks.7
What helps immediately with a calf cramp? Pull your toes towards you, or stand up and press your heel into the floor. This stretches the cramped muscle. Gentle massage helps afterwards. For cramps during exercise, stretching is considered the most effective immediate help.11
What deficiency is behind calf cramps? Magnesium is the most common suspicion, and a deficiency really can trigger cramps.1 Often, though, there's no deficiency behind it at all.10 A blood test shows whether magnesium, potassium or calcium is low. More on this in Magnesium deficiency: symptoms, causes and what you can do.
Do potassium or calcium help against cramps? The muscle needs both. Potassium contributes to normal muscle function. Calcium contributes to normal muscle function. However, an analysis of controlled studies found no evidence of benefit for supplements with potassium or calcium against cramps.4 If you suspect a deficiency, it's best to get your levels measured.
Can I take magnesium in the evening against night-time cramps? Yes. You can take magnesium with any meal; the evening makes sense for night-time cramps. In a study of 175 adults, it was taken before bed.5
What is magnesium good for in muscles? Magnesium contributes to normal muscle function. Magnesium contributes to electrolyte balance. What else magnesium does in the body is covered in Magnesium: what it does in your body.
Limits of the research and all sources
Most studies on magnesium for cramps are small and short, and they measure their results differently. For night-time calf cramps in older people without a known deficiency, the picture is mixed. A Cochrane review of 11 studies with 735 people considers a noticeable benefit in this group unlikely.22 In a study of 94 adults with magnesium oxide, cramps fell markedly in both groups, but not more with magnesium than with placebo.23 The same was true for the magnesium group in the Finnish compression-sock study.15 A further analysis found no effect in the general population, but a small one in pregnant women.24 The positive study of 175 participants was funded by the manufacturer of the tested product.5
In pregnancy too, the results aren't consistent. The Cochrane review (8 studies, 576 women) couldn't pool the studies and rates the strength of evidence as low.25 An analysis of four studies with 332 women found no difference in frequency.26 In studies with magnesium citrate (132 women) and with lactate and citrate (38 women), the supplements didn't help more than placebo.27, 28 How well magnesium helps against cramps with a confirmed deficiency has barely been studied specifically. There are no controlled magnesium studies on cramps during exercise.22
The observational data conflict: in the Swiss GP study, magnesium users had fewer cramps,6 while in a Swiss population study, they had night-time cramps more often.29 Data like this doesn't show cause. People who have cramps simply reach for magnesium more often. The picture isn't clear-cut for stretching either. A Cochrane review rates the evidence as weak. Calf stretching alone over twelve weeks made little difference in one study.30 The pickle-juice trial used artificially triggered cramps.16 The data on medicines show associations, not proven causes.12
Show all 30 sources
| # | Study | Who was studied | Result | Strength of evidence |
|---|---|---|---|---|
| 1 | Bosman et al. 2021, Proc Nutr Soc | Review article | Magnesium deficiency: muscle cramps, exhaustion, seizures, heart rhythm disorders | Review |
| 2 | Supakatisant & Phupong 2015, Matern Child Nutr | 86 pregnant women (weeks 14 to 34), magnesium bisglycinate 300 mg/day, 4 weeks | cramps halved in 86% vs. 61% (placebo); side effects the same | controlled study, university (Thailand) |
| 3 | Dahle et al. 1995, Am J Obstet Gynecol | 73 pregnant women, 3 weeks | fewer cramp-related symptoms than with placebo; blood level barely rose, excess went into urine | small controlled study |
| 4 | Patil et al. 2026, Int Dent J | 13 controlled studies on electrolytes | Pregnancy (4 studies, approx. 364 women): less frequent cramps with magnesium; night-time cramps in adults (4 studies): no difference; potassium and calcium without evidence | meta-analysis |
| 5 | Barna et al. 2021, Nutr J | 175 adults with night-time calf cramps, magnesium oxide monohydrate in the evening, 60 days | fewer (−3.4 vs. −2.6) and shorter cramps, better sleep than with placebo | controlled study, funded by the manufacturer of the product (Naveh Pharma) |
| 6 | Sebo et al. 2019, Swiss Med Wkly | 129 GP patients over 50 with night-time cramps, 2-week diary | 25% took magnesium; magnesium users had fewer cramps per day | observational study |
| 7 | Zhang et al. 2016, J Nutr | 48 controlled studies, 2,131 people | blood level rises with amount and duration, stable after around 20 weeks | meta-analysis, university-funded |
| 8 | SCF 2001 / EFSA 2006 | Regulatory assessment | upper limit of 250 mg/day from supplements | official assessment |
| 9 | Pardo et al. 2021, Nutrition | 14 comparison studies | organic forms absorbed better than inorganic; share falls with amount | systematic review |
| 10 | Allen & Kirby 2012, Am Fam Physician | Review article | cause probably muscle fatigue and nerve function rather than electrolytes; link with vascular disease, spinal stenosis, cirrhosis, dialysis, pregnancy | review |
| 11 | Nelson & Churilla 2016, Muscle Nerve | Review article on exercise cramps | overload and fatigue rather than fluid or salt deficiency; stretching as best immediate help | review |
| 12 | Garrison et al. 2012, Arch Intern Med | Prescription data for 4.2 million people, analysis from age 50 | more quinine prescriptions after starting asthma inhalers (factor 2.4), potassium-sparing (2.1) and thiazide-type diuretics (1.5); statins small (1.2) | observational study (sequence analysis), publicly funded |
| 13 | Abdulla et al. 1999, Int J Clin Pract | 365 people aged 65 and over | 50% with leg cramps, 62% of those at night; more common with poor circulation, arthritis, women | cross-sectional survey |
| 14 | Hallegraeff et al. 2012, J Physiother | 80 adults over 55, stretching calf and hamstring before bed, 6 weeks | 1.2 fewer cramps per night, less pain than without stretching | controlled study without a sham treatment |
| 15 | Kuusipalo et al. 2026, Trials | 121 people aged 50 to 85, 4 weeks | compression socks: cramps per week, median 4 to 2, less waking and pain; magnesium (chloride) not better than placebo | controlled study, foundation and university (Finland) |
| 16 | Miller et al. 2010, Med Sci Sports Exerc | Men in the laboratory, electrically triggered foot cramps | after pickle juice, the cramp ended around 49 seconds sooner than after water | laboratory trial |
| 17 | Grandner & Winkelman 2017, PLoS ONE | US population survey (NHANES) | 24 to 25% mild, 6% moderate to severe night-time leg cramps | cross-sectional study |
| 18 | Hallegraeff et al. 2017, BMC Fam Pract | 18 studies + expert survey | features: severe pain, seconds to 10 minutes, calf or foot, disrupted sleep; distinction from restless legs | systematic review |
| 19 | Brown 2015, Sleep Med Clin | Review article | a stretched foot while lying down probably triggers most cramps | review |
| 20 | Rosner et al. 2023, Mayo Clin Proc | Review article | magnesium build-up with reduced kidney function | review |
| 21 | Rabbitt et al. 2016, Age Ageing | Review article on older people | diuretics and asthma inhalers promote cramps; quinine works moderately, with rare severe side effects | review |
| 22 | Garrison et al. 2020, Cochrane Database Syst Rev | 11 studies, 735 people | older people with cramps without a known cause: benefit unlikely; pregnancy contradictory; no studies on exercise cramps | Cochrane review, publicly funded |
| 23 | Roguin Maor et al. 2017, JAMA Intern Med | 94 adults with night-time calf cramps, magnesium oxide, 4 weeks | cramps fell by around 3 per week in both groups, no difference from placebo | controlled study |
| 24 | Sebo et al. 2014, Fam Pract | 7 studies, 361 people | no effect in the general population, small effect in pregnant women | meta-analysis, weak evidence base |
| 25 | Luo et al. 2020, Cochrane Database Syst Rev | 8 studies, 576 pregnant women | magnesium for calf cramps: results inconsistent; side effects like placebo | Cochrane review, low strength of evidence |
| 26 | Liu et al. 2021, Taiwan J Obstet Gynecol | 4 studies, 332 pregnant women | frequency of cramps overall not reduced | meta-analysis |
| 27 | de Araújo et al. 2020, PLoS ONE | 132 pregnant women, magnesium citrate 300 mg/day, 4 weeks | no difference from placebo | controlled study |
| 28 | Nygaard et al. 2008, Eur J Obstet Gynecol Reprod Biol | 38 pregnant women, 360 mg magnesium lactate/citrate, 2 weeks | no difference from placebo | small controlled study |
| 29 | Stadie et al. 2026, Eur J Nutr | Lausanne population study, up to 3,887 people | magnesium users had night-time cramps more often | observational study |
| 30 | Hawke et al. 2021, Cochrane Database Syst Rev | 3 studies, 201 people aged 50 and over | stretching calf and thigh: possibly less pain; calf stretching alone for 12 weeks, little difference | Cochrane review, low strength of evidence |
Author: PRONESIUM Editorial Team · Last reviewed: 01/10/2026 · This article does not replace medical advice.




