Educational journalism, not medical advice. Every claim here is checked against its cited sources by editor Tim Bunce — a health writer, not a physician. It isn’t specific to your situation: for health decisions, talk to your own clinician. How we work →
The 60-second version
The conventional “cramps are caused by electrolyte loss and dehydration” story has been substantially overturned by the better-controlled research over the past 15 years. The current evidence supports a neuromuscular fatigue model — exercise-associated muscle cramps come primarily from altered motor-neuron control under fatigue, not from sodium or potassium imbalance. The practical evidence: pickle juice (and other strong-flavoured fluids) reduces cramp duration within 1-2 minutes via TRPV1/TRPA1 receptor activation in the mouth, not by replacing electrolytes (the cramping resolves before swallowed fluid could be absorbed). Electrolyte supplementation does prevent some types of cramps (severe dehydration, hot-weather endurance) but doesn’t address the dominant cause of recreational athletic cramps. The real prevention strategy: progressive training volume, conditioning specific to the demands of the sport, and avoiding the early-season pattern where cramps cluster.
The old model and what replaced it
For decades the standard story was: heavy sweating depletes sodium and other electrolytes, muscle membranes lose their excitability stability, cramps result. The story was intuitive but the trials didn’t support it. Adults experiencing exercise cramps usually have normal blood electrolyte levels at the time of cramping; adults with severely low electrolytes often don’t cramp.
The Schwellnus 2009 review pulled together the contradictory evidence and proposed the neuromuscular fatigue model: cramps come from altered control of alpha motor neurons under fatigue, not from peripheral electrolyte imbalance Schwellnus 2009. The follow-up work has substantially supported this picture, with several specific findings:
- Cramping muscles show high motor-neuron activation on EMG, not low activation as the membrane-excitability model predicted.
- Reflex-inhibition stretching (passive stretching of the cramping muscle) reliably resolves cramps within seconds — consistent with neural mechanism, not electrolyte.
- Pickle juice and other strong-flavoured fluids reduce cramp duration through TRPV1/TRPA1 receptor activation in the mouth and pharynx, producing reflex motor-neuron inhibition Miller 2010.
“Exercise-associated muscle cramps are most consistently associated with neuromuscular fatigue rather than electrolyte imbalance or dehydration. The historical electrolyte-imbalance model is not well-supported by controlled-trial evidence.”
— Schwellnus, Br J Sports Med, 2009 view source
When electrolytes actually help
The neuromuscular fatigue model doesn’t mean electrolytes never matter. They do, in specific scenarios:
- Severe dehydration (3-5% body weight loss) — ultraendurance events in heat, full-day hard hiking, multi-hour rowing. Sodium replacement matters at this level of loss.
- Heat acclimation phase — the first 5-10 days of training in hot conditions. Sodium needs are temporarily elevated.
- Adults on diuretics, low-sodium diets, or with hyperhidrosis — medical situations where baseline electrolyte status is already compromised.
- Very long exercise (5+ hours) — cumulative losses become substantial.
For the typical 30-90 minute recreational workout, electrolyte supplementation is unnecessary for cramp prevention.
What actually prevents cramps
- Sport-specific conditioning. Cramps cluster in early-season athletes who haven’t built up to the demands of their sport. Progressive training volume is the dominant prevention strategy.
- Stretching before high-cramp-risk activity. Specifically the muscles that historically cramp. The neuromuscular mechanism is reduced by elastic-tissue preparation.
- Pacing. Cramps often occur when an athlete pushes past their training-volume-adapted intensity. Don’t race at intensities you haven’t trained.
- Adequate carbohydrate fuelling for long-duration exercise. Glycogen depletion contributes to the fatigue that triggers cramps.
- Magnesium supplementation may help in some adults — small trial evidence supports it for adults with documented low magnesium status, weaker support for general use.
How to actually stop a cramp
- Passive stretching of the cramping muscle. The first-line treatment, evidence-supported across decades. Reflex inhibition resolves the cramp within seconds.
- Pickle juice or strong vinegar — 30-60 mL of either reduces cramp duration via mouth-pharynx receptor activation. Effect kicks in within 1-2 minutes, far faster than electrolyte absorption could explain.
- Stop the offending activity if cramps recur. Push-through patterns lead to muscle damage and prolonged cramping.
- Hydrate normally — dehydration isn’t the cause but it’s not helpful either.
- Don’t panic about electrolytes for typical recreational cramping. Address the conditioning gap, not the electrolyte myth.
Practical takeaways
- The electrolyte/dehydration model of exercise cramps is largely overturned. The dominant cause is neuromuscular fatigue.
- Cramps cluster in early-season, undertrained, or pushed-too-hard athletes. The prevention is conditioning, not supplements.
- Pickle juice and strong vinegar work fast (1-2 min) via mouth-pharynx reflex inhibition, not electrolyte replacement.
- Electrolyte supplementation matters for ultraendurance, hot-weather acclimation, multi-hour exercise, and specific medical situations — not typical recreational workouts.
- First-line treatment: passive stretching of the cramping muscle. Resolves within seconds.
The honest counter-argument: is the electrolyte story completely dead?
It would be dishonest to leave you thinking the science is fully settled. It is not. The "neuromuscular fatigue" model is the strongest explanation we have, but a respectable minority of researchers argue that electrolyte and fluid loss still matter for a specific subgroup of athletes, and the honest answer is that both camps are looking at real data.
The case against electrolytes rests largely on observational fieldwork. In a prospective study of 210 Ironman triathletes, the athletes who cramped were not distinguishable by their blood chemistry: there were no significant differences in pre-race-to-post-race serum sodium, potassium, or body-weight change between crampers and non-crampers. What actually predicted cramping was a faster race time and a personal history of cramping in recent races Schwellnus 2011. In plain terms, the people who cramped were the ones pushing hardest relative to their conditioning, not the ones who were saltiest or most dehydrated. Four separate prospective cohort studies in marathon runners and triathletes have reached the same conclusion: no measurable link between electrolyte abnormalities and cramping at the moment it happens.
So where does the disagreement come from? Two places. First, the field studies measure blood electrolytes, but cramping is a problem of the nerve and muscle, and a normal blood sodium reading does not perfectly rule out shifts inside or around the muscle cells where the action is. Second, the dehydration-and-sodium model still has plausible laboratory support and a logical mechanism for the rare athlete losing genuinely massive amounts of salty sweat over many hours. The current consensus, reflected in narrative reviews of the topic, is not "electrolytes never matter" but rather that exercise cramps are multifactorial, with neuromuscular fatigue as the dominant driver and fluid or sodium status as a secondary contributor that becomes meaningful mainly at the extreme end of duration and heat described earlier in this article. The practical upshot is unchanged: for the ordinary workout, a sports drink is not your cramp insurance. But "the electrolyte theory is wrong" is better stated as "the electrolyte theory has been overpromoted and is, at most, a minor character in most cramps."
Night cramps are a different problem (and far more common than gym cramps)
Most people who search for "electrolytes and cramps" are not ultramarathoners. They are often older adults waking up at 2 a.m. with a knotted calf. It is worth saying clearly: nocturnal leg cramps are a distinct condition from exercise-associated cramps, and much of the exercise research above does not transfer to them.
They are extraordinarily common with age. In a review of nocturnal leg cramps in older people, roughly one-third of adults over 60 reported rest cramps in a recent two-month window, rising to about half of those aged 80 and over, and they affect women somewhat more often than men Rabbitt 2016. Unlike exercise cramps, which strike during or just after hard effort, idiopathic night cramps happen at rest, overwhelmingly in the calf, and they disrupt sleep enough to genuinely dent quality of life.
"Idiopathic" means no cause is found, and that is the usual situation. But two things are worth flagging to a clinician. First, some medications appear to predispose people to cramps; the same review highlights diuretics (water pills) and inhaled long-acting beta-agonists, a class of asthma and COPD inhalers, as the drugs most consistently linked to leg cramping Rabbitt 2016. If your night cramps started after a medication change, that is a conversation to have rather than a problem to self-treat. Second, cramps that occur throughout the day, spread beyond the calves, or come with weakness or numbness are more likely to reflect an underlying neurological or systemic condition and deserve a medical look rather than a magnesium tablet.
The good news is that the first-line treatment is the same one that works for exercise cramps and costs nothing: passive stretching of the affected muscle. The evidence for a nightly stretching routine as prevention is genuinely mixed, with one randomized trial of 80 people finding fewer and milder cramps and a larger trial of 191 people finding no benefit Rabbitt 2016. It is low-risk and reasonable to try, but go in with modest expectations rather than treating it as a guaranteed fix.
What the magnesium evidence actually shows
Magnesium is the supplement most people reach for, and it deserves a clearer verdict than the usual "it might help." The strongest summary is a 2020 Cochrane systematic review that pooled the randomized trials, and its conclusions are sobering for anyone hoping for a simple pill Garrison 2020.
For older adults with ordinary idiopathic cramps, the kind that includes most night cramps, magnesium essentially failed. Across trials, the difference versus placebo in cramp frequency was small and not statistically significant: about 0.18 fewer cramps per week, with a confidence interval that comfortably straddles zero. The review's bottom line is blunt, that "it is unlikely that magnesium supplementation provides clinically meaningful cramp prophylaxis to older adults" Garrison 2020. An evidence-based clinical review in American Family Physician reached the same conclusion, listing magnesium among the treatments that current evidence does not support for idiopathic nocturnal cramps Herzberg 2017.
Two important caveats keep this from being a flat "magnesium is useless." First, the Cochrane authors found no randomized trials at all testing magnesium for exercise-associated cramps, so for the gym-and-endurance scenario this article is mostly about, magnesium is simply untested rather than disproven Garrison 2020. Second, there is a narrow, defensible exception: people with a documented low magnesium level (which a blood test can confirm) have a genuine deficiency to correct, and that is a medical situation, not a general prevention strategy. The takeaway is to stop treating magnesium as a reflexive cramp cure for everyone. For the average adult with normal magnesium, the best randomized evidence says it is unlikely to help, and the money is better spent on the conditioning and stretching that actually move the needle.
Pregnancy is its own murky chapter, and it is one where you should defer to your maternity clinician rather than the internet. Leg cramps are common in pregnancy, especially the third trimester, and a 2020 Cochrane review of eight small trials in 576 women looked at magnesium, calcium, and B vitamins Luo 2020. The honest summary is uncertainty: the studies measured outcomes in incompatible ways and the certainty of evidence was rated low to very low, leaving it "unclear whether any of the interventions provide an effective treatment" Luo 2020. Because supplement choices in pregnancy carry their own safety considerations, this is firmly a "talk to your provider before starting anything" situation rather than a do-it-yourself one.
Why quinine is the wrong answer for cramps
For decades, the one drug that reliably reduced cramps was quinine, the same compound once drawn from cinchona bark and still familiar as the bitter note in tonic water. It works: pooled trial data show quinine cuts cramps by roughly 28% over a two-week period, on the order of one extra cramp-free day in fourteen Rabbitt 2016. That modest benefit, however, comes with a risk profile serious enough that regulators have moved against using it for cramps at all.
The problem is rare but catastrophic immune reactions. Quinine can trigger a sudden, severe drop in platelets (thrombocytopenia), which can cause dangerous bleeding, and related conditions that can permanently damage the kidneys. Reviews place the risk of quinine-induced low platelets somewhere between roughly 1 in 1,000 and 1 in 3,500 users, alongside dose-related effects on hearing, vision, and heart rhythm Rabbitt 2016. Because the harm can be life-threatening and the benefit is small, the U.S. Food and Drug Administration has not approved quinine for the treatment or prevention of leg cramps, and clinical guidance is that it should be considered only after a frank discussion of those severe potential adverse effects, if at all Herzberg 2017.
The practical message is simple and worth repeating because the folk remedy persists: do not reach for tonic water or leftover quinine tablets to head off cramps. The amount of quinine in tonic water is far too low to do anything useful, and prescription-strength quinine carries a risk that is not worth taking for a self-limiting muscle spasm that a few seconds of stretching will usually resolve. If cramps are frequent enough to tempt you toward medication, that is the signal to see a clinician, who can check for the treatable causes and medication culprits noted above, rather than to experiment on yourself.
References
Schwellnus 2009Schwellnus MP. Cause of exercise associated muscle cramps (EAMC) — altered neuromuscular control, dehydration or electrolyte depletion? Br J Sports Med. 2009;43(6):401-408. View source →Miller 2010Miller 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. View source →Schwellnus 2011Schwellnus 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:10.1136/bjsm.2010.078535. PMID: 21148567. View source →Rabbitt 2016Rabbitt L, Mulkerrin EC, O'Keeffe ST. A review of nocturnal leg cramps in older people. Age Ageing. 2016;45(6):776-782. doi:10.1093/ageing/afw139. PMID: 27515677. View source →Garrison 2020Garrison SR, Korownyk CS, Kolber MR, et al. Magnesium for skeletal muscle cramps. Cochrane Database Syst Rev. 2020;9(9):CD009402. doi:10.1002/14651858.CD009402.pub3. PMID: 32956536. View source →Luo 2020Luo L, Zhou K, Zhang J, Xu L, Yin W. Interventions for leg cramps in pregnancy. Cochrane Database Syst Rev. 2020;12(12):CD010655. doi:10.1002/14651858.CD010655.pub3. PMID: 33275278. View source →Herzberg 2017Herzberg J, Stevermer JJ. Treatments for nocturnal leg cramps. Am Fam Physician. 2017;96(7):online. View source →