Leg cramps while running: why they happen and how nutrition helps
Mavr Sports Nutrition Team
Updated September 28, 2026. 8 min read.
Quick answer
Leg cramps while running are mainly caused by neuromuscular fatigue: running harder or longer than your muscles are trained for, which is why they often hit late in races.
Sodium and fluid loss are a contributing factor for heavy or salty sweaters in long, hot events, not the main cause.
The best prevention is pacing and training that match your race, plus 30-60g of carbs per hour on long runs to delay fatigue.
Heavy or salty sweaters should also replace sodium (roughly 300-700mg per hour on long or hot efforts) and drink to thirst.
Magnesium and potassium supplements have not been shown to prevent cramps.
4 key facts
The strongest predictor of cramping is running faster or longer than you trained for, not low sodium.
Sodium (400-1,500mg lost per liter of sweat) and fluid losses can add to cramp risk for heavy or salty sweaters in long, hot events.
Running low on carbs speeds up muscle fatigue, so fueling during long runs helps delay cramps.
Mavr adjusts your sodium and hydration targets per session based on conditions and sweat rate.
It happens fast. One minute you're running fine, the next your calf seizes up like someone jabbed a knife into your muscle. You stop, you stretch, you massage it, and eventually it releases — but your pace is shot and your confidence is gone.
Running cramps are one of the most frustrating problems in endurance sport. They feel random, but they are not. They have specific causes, and good pacing and fueling can lower your risk.
The 3 real causes of leg cramps while running
1. Neuromuscular fatigue (the main cause)
This is the main driver of muscle cramps during exercise. When you run harder or longer than your legs are trained for, the nerve signals that tell a muscle to contract get stronger and the signals that tell it to relax get weaker. The muscle can lock into a sustained contraction: a cramp. This is why cramps often hit late in races, especially if you started faster than your training supports. Running low on glycogen (stored carbohydrate) makes that fatigue come sooner, which is where nutrition helps.
2. Sodium loss (a factor for salty sweaters)
Sodium loss is a contributing factor, not the main cause. It matters most for heavy or salty sweaters in long, hot events. You lose roughly 400-1,500mg of sodium per liter of sweat, so on a 2-hour run in warm weather you might lose 1,000-3,000mg. If you only drink plain water, you replace the fluid but not the salt.
Sodium helps carry the electrical signals that control your muscles. But runners who cramp in races have not been found to have lower blood sodium than runners who do not. Salt may still help the smaller group of runners with very high sodium losses, but for most runners it is not what sets off a cramp.
3. Dehydration
Losing more than 2% of your body weight in fluid hurts performance and may add to cramp risk, mostly in long, hot events. It reduces blood volume, meaning less oxygen and fewer nutrients reach your muscles, so they tire sooner.
What does NOT cause cramps (despite what you've heard)
Lactic acid: lactate clears within minutes after exercise. It does not cause cramping.
Magnesium deficiency: magnesium is important, but magnesium supplements have not been shown to prevent exercise-associated cramps in well-fed athletes.
Potassium deficiency (banana theory): potassium loss in sweat is relatively small (150–250mg per liter). Sodium loss is 3–6x higher. Eating a banana will not fix a sodium deficit.
Not stretching enough: stretching can relieve a cramp, but lack of stretching does not cause it.
Nutrition that May lower your cramp risk
Nutrition cannot fully fix cramps that come from running faster or longer than you trained for. Pacing and training come first: build long runs and race-pace work gradually, and start races at a pace your training supports. Fueling well delays fatigue, and sodium matters most if you are a heavy or salty sweater.
1. Get enough sodium
Light sweater / cool weather
Sodium Target300–500mg/hour
How to Get It1 electrolyte drink or salted snack
Moderate sweater / normal conditions
Sodium Target500–700mg/hour
How to Get ItElectrolyte drink + 1 salt tab or salty food
Heavy sweater / hot weather
Sodium Target700–1,000mg/hour
How to Get ItElectrolyte drink + salt tabs + salted foods
Sweat Level
Sodium Target
How to Get It
Light sweater / cool weather
300–500mg/hour
1 electrolyte drink or salted snack
Moderate sweater / normal conditions
500–700mg/hour
Electrolyte drink + 1 salt tab or salty food
Heavy sweater / hot weather
700–1,000mg/hour
Electrolyte drink + salt tabs + salted foods
2. Stay hydrated
Before the run: 500–700ml with sodium in the 2 hours before starting.
During the run: 400–700ml/hour — drink to thirst, but do not skip it.
After the run: replace 150% of fluid lost (weigh yourself before and after to measure).
3. Fuel with carbs to delay fatigue
Since glycogen depletion speeds up neuromuscular fatigue, staying on top of carb intake during long runs helps delay the fatigue that sets up cramps.
Runs over 60 minutes: consume 30–60g carbs/hour.
Start fueling at 20–30 minutes in — do not wait until you feel tired.
Use dual-source carbs (glucose + fructose) for runs over 2 hours.
Quick fix: what to do when you cramp mid-run
Stop and gently stretch the cramped muscle — do not force it.
Drink an electrolyte solution immediately (not plain water).
Take a gel if you have not been fueling, since running low on carbs speeds up fatigue.
Salt tab or salty snack if available.
Walk for 2–3 minutes before resuming running at an easier pace.
Attack the causes you can control
The biggest lever is pacing: most late-race cramps come from asking your legs for more than they are trained for. On the nutrition side, keep carbs coming (30-60g per hour past 75-90 minutes), because a fatigued, glycogen-depleted muscle is more cramp-prone than a fueled one. If you are a heavy or salty sweater, also aim for 300-700mg of sodium per hour on long or hot efforts, more if you finish caked in white residue. Dial those in over a few long runs and "random" late-race cramps often become less common.
Setting your sodium and carb targets from your sweat rate and the day's conditions is something Mavr can do automatically. But the approach above (pace to your training, stay fueled, replace sodium if you sweat a lot) is the practical fix, and you can start testing it on your very next long run.
Frequently asked questions
Does eating a banana before running prevent cramps?
Not really. The "banana prevents cramps" idea comes from the potassium theory, but most running cramps come from muscle fatigue, and potassium loss in sweat is small. A banana has only about 400mg of potassium and almost no sodium. It is still a good carb snack before a run. If you are a salty sweater, add a salted pretzel or an electrolyte drink for sodium.
Why do I always cramp in the same muscle?
Repeated cramping in the same muscle (usually calf or hamstring) often means that muscle is working harder than others — possibly due to biomechanics, muscle imbalances, or overcompensation from a previous injury. The nutritional prevention is the same, but you may also benefit from strength training and mobility work on that specific muscle.
Should I take salt tablets for running cramps?
Salt tablets do not reliably stop cramps, because most cramps come from muscle fatigue rather than salt loss. They can help heavy or salty sweaters in long, hot events, taken with plenty of water. For most runners, an electrolyte drink mix that provides sodium along with fluid is simpler. A typical salt capsule has about 200-250mg of sodium (some brands up to about 500mg), and 1-3 per hour is common for long runs in warm conditions.
Why do I only cramp during races and not training?
Race intensity is higher than training, which means more sweating, faster glycogen depletion, and greater neuromuscular fatigue. You are also less likely to drink and fuel consistently during a race because of adrenaline and focus on performance. Start at a pace your training supports, and practice your race-day fueling and hydration plan in training.
General guidance for healthy adults, not medical advice. Talk to a doctor or registered dietitian if you have a health condition, take medicines or have special dietary needs.
Mavr Sports Nutrition Team. The Mavr sports-nutrition team translates peer-reviewed endurance research (Jeukendrup, Burke, the ISSN) into daily fueling for runners and triathletes.