What causes muscle cramps?
A muscle cramp usually comes from a tired muscle whose nerves misfire: the spinal cord fires off bursts of signals the brain never sent. Lack of water or salt matters less than people think: among 210 Ironman triathletes, the 43 who cramped were no more dehydrated than the others and had no lower blood sodium (Schwellnus, 2011).
Simplified diagram of an adult calf. Nerve signals, contraction, brake and pain shown as relative levels: all the curves are estimates (dashed).
What causes muscle cramps?
A cramp is a contraction you don't control. Tap part of the drawing to see it alone.
Animation stopped: your device asks for less motion. Each situation shows its key moment; the arrows move through time.
Keyboard: 1 to 4 the situation, Space pause, L slow motion, ← → half a second back or forward, Esc show everything.
Sources: contraction, calcium and filaments (StatPearls, Pham and Puckett, 2023). Neuromuscular hypothesis (Schwellnus, Br J Sports Med, 2009). Cramp calmed by the tendon's nerves (Khan and Burne, J Neurophysiol, 2007). Triathletes: not more dehydrated, not lower in salt (Schwellnus, 2011). Leg cramps, mostly at night: 50% of 365 patients aged 65 and older (Abdulla, 1999), 58% of 205 women in the third trimester (Abandeh, 2024). Signal frequency, brake and pain: illustrative levels.
Frequently asked questions about muscle cramps
Why do you get cramps at night?
Night cramps usually have no clear cause: the leading idea is a calf that stays shortened, with the foot pointed under the blanket. In the lab, squeezing a muscle that is already shortened is the easiest way to trigger a cramp (Khan and Burne, 2007). They are common: half of 365 patients aged 65 and older at a clinic had leg cramps, most often at night (Abdulla, 1999). Pregnancy, some medications, and blood vessel or nerve diseases also make them more likely (Allen and Kirby, 2012).
Does magnesium work for cramps?
Magnesium does not work for cramps in older adults, according to a Cochrane review: 0.18 fewer cramps per week than a placebo, a difference that means nothing in practice (5 studies, 307 people, Garrison, 2020). In pregnancy, the results contradict each other. For exercise cramps, the review found no trials at all. A true magnesium deficiency, found by a blood test, is a different situation: that one can make cramps more likely (MSD Manual).
What should you do during a calf cramp (charley horse)?
During a calf cramp, or charley horse, stretch the muscle: keep the leg straight and pull your toes toward you, or stand up and put your foot flat on the floor. Stretching pulls on the tendon, whose sensors brake the signals that lock up the muscle (Khan and Burne, 2007). A cramp lasts from a few seconds to 10 minutes (NHS). Massage helps too. Pain relievers act too late for the cramp itself, but can ease the soreness that follows.
Do cramps come from a lack of water or salt?
Most of the time, cramps do not come from a lack of water or salt: among 210 Ironman triathletes, the 43 who cramped were no more dehydrated than the others and had no lower blood sodium (Schwellnus, 2011). What they shared: a faster race, with similar training, and a history of cramps. Fatigue of the muscle and its nerves is the best-supported explanation. Salt can matter in some cases, as a small study of 10 men suggests (Lau, 2021).
When should you worry about a cramp?
See a doctor if a cramp lasts more than 10 minutes, keeps coming back to the point of disturbing your sleep, or comes with swelling or numbness in the leg (NHS). See a doctor promptly for sudden weakness or loss of feeling, cramps after heavy fluid loss (vomiting, diarrhea), or cramps in the arms or trunk (MSD Manual). Muscle pain after starting a medication, a statin for example, is also worth asking about, without stopping the treatment on your own.
True or false?
A cramp starts in the muscle itself.
False. In 8 out of 13 volunteers who had a calf cramp triggered, the electrodes showed electrical activity coming from the spinal cord, with no voluntary command (Khan and Burne, 2007).
Your calf can stay sore after a cramp.
True. Discomfort or pain can last up to 24 hours after the cramp (NHS).
Quinine is a good remedy for leg cramps.
False. It reduces cramps a little but can cause serious side effects: the American Academy of Neurology advises against routine use (Katzberg, 2010). In France, it is limited to stubborn night cramps (ANSM, 2012).
This page as text
The same information as the charts, to read without animation: for each chart, the values at the main moments, then the notes with their level of evidence.
How does a muscle contract, then relax?
You push up onto the ball of your foot for 30 seconds, then let go. The nerve gives the order, calcium triggers the contraction, the filaments slide; when you relax, the calcium is pumped back.
| Seconds | Motor nerve signals (dotted) | Calcium released in the fiber (dotted) | Muscle contraction (dotted) | What happens |
|---|---|---|---|---|
| 0 s | 2 | 5 | 3 | muscle at rest |
| 15 s | 51 | 70 | 61 | the calf contracts |
| 30 s | 52 | 70 | 62 | the calf contracts |
| 45 s | 2 | 6 | 4 | the calf is relaxed |
| 60 s | 2 | 5 | 3 | the calf is relaxed |
| 75 s | 2 | 5 | 3 | the calf is relaxed |
| 90 s | 2 | 5 | 3 | the calf is relaxed |
Key points
- The nerve gives the order (From 9 to 42 s, Shown in humans)
Each motor nerve signal releases a chemical messenger (acetylcholine) where the nerve meets the muscle. An electrical wave then runs along the whole fiber. Source: Pham and Puckett, « Physiology, Skeletal Muscle Contraction », StatPearls, 2023 - Calcium sets it off (From 10 to 42 s, Shown in humans)
The wave opens a storage compartment inside the fiber (the sarcoplasmic reticulum), which releases its calcium. Calcium uncovers the sites where the myosin heads grab onto actin. Source: Pham and Puckett, « Physiology, Skeletal Muscle Contraction », StatPearls, 2023 - The filaments slide (From 11 to 42 s, Shown in humans)
The myosin heads pull the actin filaments toward the center, like rowers. No filament gets shorter: they slide past each other, and the fiber shortens. Source: Pham and Puckett, « Physiology, Skeletal Muscle Contraction », StatPearls, 2023 - Relaxing takes energy too (From 40 s, Shown in humans)
When the nerve goes quiet, pumps put the calcium back into storage, using ATP. Without calcium, myosin lets go and the muscle relaxes. Source: Pham and Puckett, « Physiology, Skeletal Muscle Contraction », StatPearls, 2023 - Two sensors in every muscle (Throughout, Shown in humans)
The muscle spindle measures how much the muscle is stretched; the Golgi tendon organ measures its tension. Both keep sending signals to the spinal cord, which adjusts the motor nerve's signals. Source: Schwellnus, « Cause of exercise associated muscle cramps (EAMC): altered neuromuscular control, dehydration or electrolyte depletion? », Br J Sports Med, 2009
What happens during a cramp?
End of a run, tired calf: at 20 seconds, the cramp (a charley horse) hits. If you do nothing, here it eases on its own after about 50 seconds (a length chosen for the example).
| Seconds | Motor nerve signals (dotted) | Muscle contraction (dotted) | Pain (dotted) | Golgi organ brake (dotted) | What happens |
|---|---|---|---|---|---|
| 0 s | 35 | 30 | 0 | 40 | end of the workout, the muscle tires |
| 15 s | 40 | 32 | 0 | 22 | end of the workout, the muscle tires |
| 30 s | 95 | 100 | 85 | 20 | cramp under way |
| 45 s | 94 | 99 | 85 | 21 | cramp under way |
| 60 s | 90 | 96 | 85 | 24 | cramp under way |
| 75 s | 26 | 30 | 50 | 27 | the cramp has eased |
| 90 s | 5 | 5 | 25 | 30 | the cramp has eased |
Key points
- Fatigue throws the sensors off (From 0 to 21 s, Hypothesis)
According to the neuromuscular hypothesis, a tired muscle gets more signals from its spindles and less braking from its Golgi organs. These changes come mostly from animal experiments; in humans, it is the best-supported explanation, not a certainty. Source: Schwellnus, « Cause of exercise associated muscle cramps (EAMC): altered neuromuscular control, dehydration or electrolyte depletion? », Br J Sports Med, 2009 - A contraction you don't control (From 19 to 72 s, Shown in humans)
In the lab, a calf cramp was triggered in 8 of 13 volunteers by squeezing hard with the muscle already shortened. The electrodes showed electrical activity coming from the spinal cord, with no voluntary command. Source: Khan and Burne, « Reflex inhibition of normal cramp following electrical stimulation of the muscle tendon », J Neurophysiol, 2007 - Not more dehydrated, not lower in salt (From 19 s, Shown in humans)
Among 210 triathletes followed during an Ironman, the 43 who cramped had not lost more weight and did not have lower blood sodium. What they shared: a faster race, with similar training, and a history of cramps. Source: Schwellnus, Drew and Collins, « Increased running speed and previous cramps rather than dehydration or serum sodium changes predict exercise-associated muscle cramping », Br J Sports Med, 2011 - Salt can matter, sometimes (From 30 s, Shown in humans)
In a small study of 10 men who ran in the heat, drinking plain water made the calf easier to cramp with electrical stimulation; a salty oral rehydration drink made it more resistant. Source: Lau, Kato and Nosaka, « Effect of oral rehydration solution versus spring water intake during exercise in the heat on muscle cramp susceptibility of young men », J Int Soc Sports Nutr, 2021 - How long does a cramp last? (From 45 s, Shown in humans)
In a survey of 218 patients at a family doctor's practice, cramps at rest lasted 9 minutes on average. The NHS (the UK health service) says anywhere from a few seconds to 10 minutes. Source: Naylor and Young, « A general population survey of rest cramps », Age Ageing, 1994 - The muscle stays sore (From 72 s, Shown in humans)
After a cramp, the calf can stay sore for up to 24 hours. Source: NHS, « Leg cramps »
Why does stretching the muscle help?
Same cramp, but at 30 seconds you pull your toes toward you. The tendon tightens, the Golgi organ switches on and brakes the signals: the cramp eases within a few seconds.
| Seconds | Motor nerve signals (dotted) | Muscle contraction (dotted) | Pain (dotted) | Golgi organ brake (dotted) | What happens |
|---|---|---|---|---|---|
| 0 s | 35 | 30 | 0 | 40 | end of the workout |
| 15 s | 40 | 32 | 0 | 22 | end of the workout |
| 30 s | 92 | 98 | 85 | 40 | stretching |
| 45 s | 7 | 9 | 24 | 58 | stretching |
| 60 s | 5 | 6 | 16 | 28 | the muscle is relaxed |
| 75 s | 5 | 5 | 13 | 26 | the muscle is relaxed |
| 90 s | 5 | 5 | 12 | 25 | the muscle is relaxed |
Key points
- The tendon's brake (From 29 to 60 s, Shown in humans)
In volunteers with a cramp, stimulating the nerve fibers of the Achilles tendon shut down the cramp's electrical activity and eased the pain. People who cramped had weaker braking than the others. Source: Khan and Burne, « Reflex inhibition of normal cramp following electrical stimulation of the muscle tendon », J Neurophysiol, 2007 - Why stretching works (From 29 to 60 s, Hypothesis)
Stretching a contracted muscle pulls hard on its tendon: the Golgi organ switches on and, in the spinal cord, brakes the signals going to the muscle. It is the best current explanation, not yet proven in every detail. Source: Schwellnus, « Cause of exercise associated muscle cramps (EAMC): altered neuromuscular control, dehydration or electrolyte depletion? », Br J Sports Med, 2009 - Stretch gently until it passes (From 30 s, Shown in humans)
For a cramp during exercise, a 2022 review recommends a gentle, sustained stretch until the symptoms are gone, then looking for what may have set it off. Source: Miller et al., « An evidence-based review of the pathophysiology, treatment, and prevention of exercise-associated muscle cramps », J Athl Train, 2022 - What about prevention? (From 45 s, Shown in humans)
In people 55 and older, stretching the calf and the back of the thigh every day for 6 weeks made night cramps a little less painful (1 trial, 80 people). The effect on how often they happen remains uncertain (Cochrane review: 3 trials, 201 people). Source: Hawke et al., « Non-drug therapies for the secondary prevention of lower limb muscle cramps », Cochrane Database Syst Rev, 2021 - Magnesium (From 55 s, Shown in humans)
In adults with an average age of 61 to 69, with cramps of no known cause, magnesium made almost no difference: 0.18 fewer cramps per week than a placebo (5 studies, 307 people). Source: Garrison et al., « Magnesium for skeletal muscle cramps », Cochrane Database Syst Rev, 2020 - Quinine: not for routine use (From 60 s, Shown in humans)
Quinine cuts the number of cramps a little, but it can cause serious side effects (a drop in platelets, severe allergic reactions). The American Academy of Neurology advises against routine use. In the US, quinine is approved only for malaria: the FDA ordered unapproved quinine products off the market in 2006 and warned in 2010 against using it for leg cramps. Source: Katzberg, Khan and So, « Assessment: symptomatic treatment for muscle cramps », Neurology, 2010
Cite this page
To cite this page in a paper, an article or a presentation:
Metabolive. "What causes muscle cramps?" Updated October 29, 2026. https://metabolive.com/en/effort-stress/muscle-cramps.
Embed this chart
To show this animated chart on your site, paste this code into your page. The link to Metabolive stays visible under the chart.
<iframe src="https://metabolive.com/en/embed/muscle-cramps" width="100%" height="720" style="border:0" title="What causes muscle cramps?" loading="lazy"></iframe>