Muscle Cramps: What Really Causes Them, and Do Electrolytes or Magnesium Help?
Research points to fatigue more than dehydration. When electrolytes help, why magnesium probably won't, and what to do mid-cramp.

Key takeaways
- Fatigue and a history of cramping are the best-supported causes of exercise cramps.
- Dehydration alone doesn't reliably predict cramps, but replacing heavy sweat with plain water may raise risk.
- Stretching the muscle is the quickest relief; a salty or sour shot may end a cramp faster through a reflex.
- A Cochrane review found magnesium doesn't meaningfully reduce night cramps in older adults.
Ask a room of runners or cricketers what causes muscle cramps and most will say "dehydration" or "low salt". Ask the researchers and the answer is more interesting, and more useful. Here's what the evidence says about exercise cramps, whether electrolytes or magnesium help, and what to do when a calf locks up mid-match.
What is a muscle cramp?
A cramp is a sudden, painful, involuntary contraction that won't let go: usually the calf, hamstring, quads or the small muscles of the foot. Two types get mixed up:
- Exercise-associated muscle cramps happen during or soon after hard exercise.
- Night (nocturnal) leg cramps wake people up, mostly older adults and pregnant women, with no exercise involved.
The causes and the evidence differ, so we'll take them separately.
What causes exercise cramps? The evidence

1. Neuromuscular fatigue (strong evidence)
The leading explanation is "altered neuromuscular control". When a muscle is fatigued, the nerve signals telling it to contract get stronger and the signals telling it to relax get weaker, until it locks. A major review found this hypothesis has the most support from human cramp models, epidemiology and animal research.1
The clearest field evidence comes from a prospective study of 210 Ironman triathletes. Those who cramped were the ones who raced faster than their training suggested, plus those with a history of cramping. Body-weight loss and blood electrolytes were no different between crampers and non-crampers.2
2. A history of cramping (strong evidence)
If you've cramped before, you're more likely to again. In the triathlon study it was one of only two independent risk factors.2
3. Dehydration alone (weak evidence)
Surprisingly, losing water by itself doesn't reliably predict cramps.1,2 That doesn't mean hydration is irrelevant, just that it's rarely the whole story.
4. Low sodium after drinking plain water (some evidence)
Here's where electrolytes do come in. In a lab study, men ran downhill in 35–36°C heat until they'd lost 2% of their body weight, then drank either plain water or an ORS-like electrolyte drink. After plain water, their muscles became more prone to cramping and blood sodium and chloride fell. After the electrolyte drink, susceptibility went down.3 Replacing heavy sweat losses with water alone may make things worse.

What helps during a cramp
- Stop and stretch the muscle gently. For a calf, pull your toes towards your shin; for a hamstring, straighten the knee. Stretching is the most reliable immediate relief.
- Something strongly salty or sour. In a controlled trial, a small shot of pickle juice (about 75 ml) ended electrically induced cramps about 49 seconds sooner than water. That happened far too fast for any electrolytes to be absorbed, so researchers think it's a reflex triggered in the mouth and throat.4
- Ease off. Since fatigue drives most exercise cramps, slowing down is often what lets you finish.
How to prevent exercise cramps
- Train for the pace you plan to race. This is the most evidence-backed prevention.2
- Don't replace heavy sweat with plain water alone on long, hot days. Include sodium.3
- Don't overdrink. Gaining weight during a long event is a hyponatremia risk.6
- Know if you're a salty sweater. White salt marks on your kit are a clue; sweat sodium varies several-fold between people.7
- Warm up, and build volume gradually in the early weeks of summer.
Does magnesium help muscle cramps?
"Magnesium for muscle cramps" is a fast-rising search in India. The best evidence is a 2020 Cochrane review of 11 randomised trials. For idiopathic night cramps in older adults (the commonest type), magnesium made no meaningful difference to cramp frequency compared with placebo. The evidence for cramps in pregnancy was conflicting and the trials were at high risk of bias.5 There's little trial evidence either way for exercise cramps.
So magnesium won't hurt most people at normal doses, but don't expect a supplement to fix cramps. If night cramps are frequent, see a doctor. Some medicines and medical conditions cause them.
So do electrolyte drinks prevent cramps?
Honestly: not on their own. Most exercise cramps come from fatigue, and no drink fixes that. Where electrolytes help is in long, hot, sweaty sessions where you'd otherwise replace litres of sweat with plain water, the scenario the lab study showed raises cramp risk.3 That's what Flow is for. Pair it with training at race pace.
Planning a long event? Our marathon hydration plan covers sweat rate and sodium.
Frequently asked questions
What is the main cause of muscle cramps during exercise?
Do electrolytes stop muscle cramps?
Which magnesium is best for muscle cramps?
How do I stop a leg cramp quickly?
References
- 1.Schwellnus MP. Cause of exercise associated muscle cramps (EAMC): altered neuromuscular control, dehydration or electrolyte depletion? Br J Sports Med. 2009;43(6):401–408. doi.org/10.1136/bjsm.2008.050401
- 2.Schwellnus MP, Drew N, Collins M. Increased running speed and previous cramps rather than dehydration or serum sodium changes predict exercise-associated muscle cramping: a prospective cohort study in 210 Ironman triathletes. Br J Sports Med. 2011;45(8):650–656. doi.org/10.1136/bjsm.2010.078535
- 3.Lau WY, Kato H, Nosaka K. Water intake after dehydration makes muscles more susceptible to cramp but electrolytes reverse that effect. BMJ Open Sport Exerc Med. 2019;5(1):e000478. doi.org/10.1136/bmjsem-2018-000478
- 4.Miller KC, Mack GW, Knight KL, et al. Reflex inhibition of electrically induced muscle cramps in hypohydrated humans. Med Sci Sports Exerc. 2010;42(5):953–961. doi.org/10.1249/MSS.0b013e3181c0647e
- 5.Garrison SR, Korownyk CS, Kolber MR, et al. Magnesium for skeletal muscle cramps. Cochrane Database Syst Rev. 2020;9:CD009402. doi.org/10.1002/14651858.CD009402.pub3
- 6.Hew-Butler T, Rosner MH, Fowkes-Godek S, et al. Statement of the Third International Exercise-Associated Hyponatremia Consensus Development Conference, Carlsbad, California, 2015. Clin J Sport Med. 2015;25(4):303–320. doi.org/10.1097/JSM.0000000000000221
- 7.Baker LB, Barnes KA, Anderson ML, Passe DH, Stofan JR. Normative data for regional sweat sodium concentration and whole-body sweating rate in athletes. J Sports Sci. 2016;34(4):358–368. doi.org/10.1080/02640414.2015.1055291
Lehans · Flow Hydration team
Writes about sugar, cramps and the claims around sports drinks, and checks each against the published trials.
First published 7 May 2026. This article is general information, not medical advice. If you have a medical condition, talk to your doctor.
Keep reading

12 October 2026 · 8 min read
Electrolytes for the Gym: When to Drink Them Before, During and After a Workout
Most short gym sessions only need water. The before, during and after timeline from the ACSM position stand, and when electrolytes earn their place.
Read more
12 October 2026 · 9 min read
Electrolyte Powder: Benefits, Uses and Who Actually Needs It
What each electrolyte does, the benefits the research supports, who needs a sachet and who doesn't, and how to read a label in India.
Read more
12 October 2026 · 8 min read
ORS vs Electrolyte Drinks: What's the Difference (and What FSSAI Changed)
ORS isn't banned, but sugary drinks can no longer use its name. The WHO formula, what FSSAI changed, and when to choose ORS over an electrolyte drink.
Read more