Summary The 2020 Cochrane review by Garrison et al. pooled 11 randomized trials of 735 participants and found that magnesium supplementation does not meaningfully reduce the frequency, intensity, or duration of idiopathic skeletal muscle cramps (the most common kind, mostly in older adults). For pregnancy-associated cramps, results are mixed and inconsistent. For exercise-associated muscle cramps, there are almost no high-quality trials. The mechanism that actually drives cramping, per the British Journal of Sports Medicine review by Schwellnus (2009), is altered neuromuscular control under fatigue, not electrolyte depletion. Newer research (Tarsitano et al., 2024) suggests 350 to 500 mg per day of magnesium may reduce post-workout muscle soreness in athletes, but the total evidence base is 73 participants. Magnesium is a real essential mineral worth getting from food. As a cramp-prevention supplement, it is mostly placebo plus regression to the mean.
Illustration showing the gap between popular belief and clinical evidence for magnesium and muscle cramps with the Cochrane review of 11 trials finding no meaningful effect on cramp frequency
The evidence gap: people swear by magnesium for cramps, but the pooled Cochrane data across 11 trials shows no meaningful effect for the most common cramp type.

If you have ever woken up at 3 a.m. with your calf locked into a knot the size of a baseball, someone has probably told you to take magnesium. Your doctor's office, your gym buddy, your favorite supplement brand, half of TikTok. The advice is everywhere.

It is also, mostly, not supported by the research.

The strongest synthesis of the evidence on magnesium and skeletal muscle cramps is a Cochrane systematic review last updated in 2020. It pools 11 randomized trials, 735 participants, and three different cramp populations. The headline finding is unflattering for the supplement industry. For the cramp type most people are actually trying to prevent (the idiopathic night cramps that show up in healthy adults, especially after age 50), magnesium does not work better than placebo.

That does not mean magnesium is useless. As an essential mineral, it matters for hundreds of biochemical processes including nerve and muscle function. There is also some promising newer data on magnesium for post-workout soreness in athletes. But the specific claim that a magnesium supplement will stop your cramps is, on the current evidence, mostly a story.

This article walks through what the Cochrane review actually found, why the dehydration-and-electrolyte story for cramps appears to be wrong, where magnesium might still help (soreness, deficiency populations), and what to do instead if you cramp regularly.

The Cochrane Review: Garrison et al. (2020)

The most rigorous evidence on this question is the Cochrane systematic review by Garrison, Korownyk, Kolber, Allan, Musini, Sekhon, and Dugre (2020), an update of an earlier 2012 review. The authors searched seven databases, screened more than 1,000 records, and ultimately included 11 randomized placebo-controlled trials with 735 participants.

The trials split into three populations:

What They Found for Idiopathic Cramps

For idiopathic skeletal muscle cramps (the night-cramp population most readers will care about), the pooled result was clear and disappointing. After four weeks of supplementation, the average reduction in weekly cramp frequency was 9.6 percent better with magnesium than with placebo. That difference was not statistically significant. The proportion of participants who experienced at least a 25 percent reduction in cramps was similar between magnesium and placebo (relative risk 1.04). No measurable benefit for cramp duration or intensity either.

The authors' summary is blunt: "It is unlikely that magnesium supplementation provides clinically meaningful cramp prophylaxis to older adults experiencing skeletal muscle cramps."

What They Found for Pregnancy Cramps

For pregnancy-associated cramps, the results were mixed. Two trials reported a benefit. Three did not. The overall pooled effect was small and the heterogeneity between trials was high. A separate observational controlled trial published the same year (Araujo et al., 2020, in PLOS ONE) followed 132 pregnant women given either oral magnesium or placebo for four weeks. Both groups improved meaningfully (a 27 percent reduction in the magnesium group versus 33 percent in the placebo group), with no statistically significant difference between them.

The bottom line for pregnancy cramps: maybe a small effect in some people, maybe nothing. The evidence does not support a confident yes.

What They Found for Side Effects

Magnesium is not a free supplement. Minor adverse events (mostly gastrointestinal, including diarrhea, nausea, and abdominal cramping) were about 50 percent more common with magnesium supplementation than placebo (relative risk 1.51). For some participants the GI symptoms affected 11 to 37 percent of those on the supplement, depending on the formulation and dose. Trading one kind of cramp for another is not a great trade.

Why "Magnesium Stops Cramps" Is the Wrong Story

The popular model of muscle cramps says: you sweat out electrolytes (sodium, magnesium, potassium), the muscles do not have enough minerals to relax, they spasm. The pickle juice videos. The Gatorade commercials. The supplement marketing.

The current scientific consensus on exercise-associated cramping does not really agree with this story.

The most influential review on cramp mechanism is by Schwellnus (2009) in the British Journal of Sports Medicine. He compared three competing theories: dehydration, electrolyte depletion, and altered neuromuscular control. The dehydration and electrolyte theories had failed multiple field studies, including comparisons of crampers versus non-crampers in the same race with similar sodium and magnesium losses. The neuromuscular control hypothesis fit the data much better.

That model goes roughly like this. As a muscle fatigues, the excitatory input from the muscle spindle (which detects stretch) keeps firing, while the inhibitory input from the Golgi tendon organ (which usually quiets the motor neuron when tension gets high) drops off. The motor neurons feeding that muscle lose their brake. They keep firing. The muscle contracts. It will not let go. That is what a cramp actually is at the cellular level: a runaway spinal reflex loop, not a mineral shortage in the muscle fiber.

Concept illustration showing the spinal reflex loop driving muscle cramps with muscle spindle excitation and reduced Golgi tendon organ inhibition under fatigue
Why magnesium probably will not stop your calf cramp: cramps appear to be driven by a fatigue-disrupted spinal reflex loop, not by mineral depletion in the muscle itself.

This is also why stretching reliably breaks an acute cramp. Lengthening the muscle activates the Golgi tendon organ, restores the inhibitory signal to the motor neuron, and shuts the loop down. It is a neural fix to a neural problem. No amount of magnesium in your bloodstream is going to override that loop in the moment, which is consistent with what trials of acute magnesium dosing have found: nothing.

If the mechanism is neuromuscular fatigue, the prevention strategies that should work are the ones that reduce or delay fatigue: building endurance gradually, training the specific muscle, pacing your effort, and getting enough rest. That same pattern shows up in the broader fatigue literature, including the practical guidance in our overtraining syndrome research writeup and the dose-response discussion in minimum effective exercise dose. Cramp prevention rides on the same base.

Where Magnesium Probably Does Help

Saying magnesium does not prevent cramps is not the same as saying the mineral is useless. There are a few places where the evidence is more interesting.

Post-Exercise Muscle Soreness

A 2024 systematic review by Tarsitano et al. in the Journal of Translational Medicine looked at magnesium supplementation in physically active people, with delayed-onset muscle soreness (DOMS) as a primary outcome. The review included 4 studies and 73 participants total (60 men, 13 women, ages 19 to 27). Across the studies:

The authors recommend that active people consume about 10 to 20 percent more magnesium than sedentary peers, ideally from food first, with supplementation about 2 hours before training if needed. Those are reasonable, conservative recommendations.

The caveat: 73 participants across all studies, mostly young men, mostly short-term protocols. This is suggestive evidence, not a slam dunk. The mechanism is plausible (magnesium plays a role in ATP regeneration, muscle relaxation, and oxidative-stress regulation), and the dose is well below the safety threshold. If post-workout soreness is wrecking your week, it is a reasonable thing to try.

Correcting an Actual Deficiency

The other place magnesium clearly helps is when you do not have enough of it. The NIH Office of Dietary Supplements magnesium fact sheet identifies four populations at elevated risk of inadequate magnesium status:

If you are in one of these groups and your symptoms include numbness, tingling, abnormal heart rhythms, fatigue, or muscle cramps that come and go without a clear trigger, magnesium status is genuinely worth checking with your doctor. A blood test (serum magnesium) is the standard starting point, though it can underestimate true tissue stores.

Get an evidence-based plan built for you

FitCraft, our mobile fitness app, pairs you with an AI coach who builds you a personalized plan around your goals, schedule, and fitness level. Every FitCraft program is designed by , MPH (Brown University) and NSCA-CSCS, with research published in the Journal of Strength and Conditioning Research and Medicine & Science in Sports & Exercise.

Take the Free Assessment Free • 2 minutes • No credit card

How Much Magnesium and From Where

If you decide to try magnesium for soreness, or just to cover your bases nutritionally, the dosing landscape is simple.

The NIH-set Recommended Dietary Allowance for adults is 310 to 320 mg per day for women and 400 to 420 mg per day for men. Pregnancy slightly increases needs. Older adults sometimes fall short. Most people eating a varied diet hit those numbers without thinking about it.

The Tolerable Upper Intake Level for supplemental magnesium specifically is 350 mg per day. This is not the upper limit from food (food magnesium is essentially unlimited and self-regulated by absorption efficiency); it is the threshold above which non-food sources start producing reliable gastrointestinal side effects in healthy people. Higher doses are sometimes prescribed clinically (for migraine, for hypertension, for severe deficiency) but should be supervised.

Food First

The best magnesium sources are deeply unsexy on a supplement label. They are also the actual answer for most people. A reasonable target is to make a few of these regulars:

About 30 to 40 percent of dietary magnesium is absorbed, and absorption is well-regulated by body status (you absorb more when you need more). This is part of why food sources rarely cause problems and supplement sources do.

If You Supplement

Choose a form with reasonable bioavailability and tolerable GI effects:

Forms to be more careful with:

Take it with food and start at half the label dose for a few days to see how your gut tolerates it. If you get loose stools, the dose is too high or the form is wrong.

What to Do Instead If You Cramp

If magnesium will not reliably stop the cramps, what will? The honest answer is: less than the internet promises, but more than nothing.

For Acute Cramps

Stretch the cramping muscle in the direction opposite the contraction. For a calf cramp, pull your toes toward your knee. For a hamstring cramp, straighten the leg and lift it. For a foot cramp, pull your toes up. This is the highest-evidence acute treatment, and it works by re-engaging the Golgi tendon organ in the muscle and shutting down the runaway reflex loop. It usually works in under 60 seconds.

Pickle juice and sour drinks have a small evidence base for shortening cramp duration in exercise contexts. The proposed mechanism is not electrolyte replacement (the volume is too small and the timing is too fast). It appears to be a reflex triggered by the strong sour taste in the back of the throat that downregulates motor neuron firing. Mustard, vinegar, and very tart drinks have the same proposed mechanism. The evidence is thin but the side-effect risk is zero.

For Recurring Cramps

Train the muscle. Exercise-associated cramps disproportionately affect muscles that are working harder than they are conditioned for. Calf cramps in runners often come from a sudden volume jump. Hamstring cramps in cyclists often come from a new gear ratio or longer ride. Progressive overload (slowly increasing demand) is also slowly increasing cramp resistance. The pattern matches what we cover in zone 2 training research for endurance: the body adapts to whatever you ask of it, but only if you let it.

Pace and recover. The pattern of cramping in the third hour of a long event, or the second set of a sprint workout, or the back half of a hike, is the neuromuscular fatigue model in action. Sustainable pacing and adequate sleep do more for cramp prevention than any supplement.

Check meds and conditions. Several drug classes (diuretics, statins, some inhalers, some psychiatric medications) raise the risk of muscle cramps as a side effect, often unrelated to electrolyte status. So do conditions like peripheral artery disease, thyroid dysfunction, and pregnancy. If your cramps are sudden, severe, or worsening, that is worth a conversation with your physician rather than a supplement order.

Yes, hydrate, but not for the cramp reason. Adequate water and electrolytes during long, hot, hard exercise are unambiguously good for performance, judgment, and thermal regulation. They are not a reliable cramp prevention tool. Drink because it helps you finish the run, not because it will stop the cramp.

The Honest Verdict

Magnesium is a real, essential mineral. Most people should get enough of it. The food sources are easy and pleasant. For active people who consistently feel sore, low-dose supplementation (within the 350 mg per day limit) is reasonable to try, particularly the glycinate or citrate forms.

What magnesium probably is not, despite the pickle-juice-and-electrolyte marketing of the last twenty years, is a reliable cramp prevention strategy. The Cochrane review across 11 trials and 735 participants is hard to argue with. The mechanism story (electrolyte depletion in the muscle) does not match what we now understand about how cramps actually start. The pickle-juice trials work for a totally different reason than people think.

Concept illustration showing where magnesium evidence is strong like deficiency correction and post-exercise soreness versus where it is weak like idiopathic and exercise-associated cramps
Where magnesium has decent evidence versus where it does not: correction of true deficiency and modest soreness reduction are reasonable bets; everyday cramp prevention is not.

If you cramp regularly and you have been chasing the magnesium fix for years, it may be worth shifting your attention to the things that actually move the needle. Progressive training so the muscle is less fatigued. Adequate sleep so the central nervous system has a margin. A reasonable diet that hits the magnesium RDA from food. And if cramps persist or change pattern, a medical evaluation rather than a louder supplement stack. For the broader recovery picture (which is where soreness, fatigue, and cramping all overlap), our active recovery research piece is a good next read.

How FitCraft Treats Nutrition and Cramping

Most fitness apps treat your plate and your training as two separate problems you figure out on your own. The result is people who eat well but train randomly, or train hard but eat for the version of themselves from five years ago.

FitCraft pairs you with an AI coach who builds your plan around the goals and constraints you actually share at signup. The training side is structured progressively, which is exactly what the cramping literature recommends as the real prevention strategy: condition the muscle to the demand before you stack on the demand. If a specific nutrition question comes up (magnesium, protein, electrolytes), the right move is the boring one: hit your basic numbers from food, supplement only where the evidence is decent, and stop chasing the next miracle on the shelf.

References

  1. Garrison SR, Korownyk CS, Kolber MR, Allan GM, Musini VM, Sekhon RK, Dugre N. "Magnesium for skeletal muscle cramps." Cochrane Database of Systematic Reviews. 2020;9:CD009402. doi:10.1002/14651858.CD009402.pub3
  2. Tarsitano MG, Quinzi F, Folino K, Greco F, Oranges FP, Cerulli C, Emerenziani GP. "Effects of magnesium supplementation on muscle soreness in different type of physical activities: a systematic review." Journal of Translational Medicine. 2024;22(1):629. PMC11227245
  3. Schwellnus MP. "Cause of exercise associated muscle cramps (EAMC) — altered neuromuscular control, dehydration or electrolyte depletion?" British Journal of Sports Medicine. 2009;43(6):401-408. doi:10.1136/bjsm.2008.050401
  4. Araujo CAL, Lorena SB, Cavalcanti GCS, Leao GLS, Tenorio GP, Alves JGB. "Oral magnesium supplementation for leg cramps in pregnancy: An observational controlled trial." PLOS ONE. 2020;15(1):e0227497. doi:10.1371/journal.pone.0227497
  5. National Institutes of Health Office of Dietary Supplements. "Magnesium Fact Sheet for Health Professionals." ods.od.nih.gov/factsheets/Magnesium-HealthProfessional/

Frequently Asked Questions

Does magnesium actually help with muscle cramps?

Probably not for the most common kind. A 2020 Cochrane review by Garrison et al. pooled 11 randomized trials and 735 participants. For idiopathic skeletal muscle cramps in older adults, the most common type, magnesium did not meaningfully reduce cramp frequency, severity, or duration compared with placebo. For pregnancy-related cramps, the evidence is mixed and inconsistent. For exercise-associated muscle cramps, there are basically no high-quality trials at all. If you cramp at night or during a run and magnesium feels like it helps you, that effect is probably placebo or correction of an underlying deficiency you did not know about.

How much magnesium should I take for muscle cramps?

There is no evidence-supported dose for cramp prevention because the evidence does not support magnesium for cramps. The NIH Office of Dietary Supplements sets the adult RDA at 310 to 420 mg per day from food, with an upper limit of 350 mg per day from supplements specifically. Doses above that are not necessarily dangerous in healthy people, but they commonly cause diarrhea, nausea, and abdominal cramping. The Cochrane review noted that minor gastrointestinal side effects were about 50 percent more common with magnesium supplementation than placebo.

What actually causes muscle cramps during exercise?

The current best-supported model is the altered neuromuscular control hypothesis. Schwellnus (2009), writing in the British Journal of Sports Medicine, argued that exercise-associated cramps result from a fatigue-driven imbalance in the spinal reflex loop. Muscle spindle activity increases, Golgi tendon organ inhibition decreases, and the motor neurons firing into the cramping muscle stay locked on. The old explanations (low sodium, dehydration, magnesium depletion) have weak evidence behind them. This is why stretching, not drinking pickle juice, is the fastest reliable way to break an acute cramp.

Does magnesium help with post-workout soreness?

There is some promising but limited evidence. Tarsitano et al. (2024) in the Journal of Translational Medicine pooled 4 studies (73 participants total) on magnesium supplementation in active adults. Doses in the 350 to 500 mg per day range were associated with reduced perceived soreness at 24 to 48 hours post-exercise and modestly attenuated muscle damage markers. The total sample is small (73 people across all studies) and most participants were young men, so this is suggestive evidence, not settled science. Treat it as a low-cost, low-risk thing to try, not a guarantee.

What foods are highest in magnesium?

Pumpkin seeds, spinach, almonds, cashews, black beans, edamame, dark chocolate, and avocados are among the best food sources. The NIH Office of Dietary Supplements notes that about 30 to 40 percent of dietary magnesium is absorbed in healthy adults. Most people who eat a varied diet with vegetables, legumes, nuts, and whole grains hit the RDA without trying. The groups at highest risk of inadequacy are people with type 2 diabetes, GI conditions like Crohn's or celiac, chronic alcohol use, and older adults whose absorption declines with age.