How to Not Get Cramps While Running: What Works

Most running cramps come down to two things: your muscles getting too fatigued or your body losing too much fluid and salt. The good news is that both are largely preventable with the right preparation. Whether you’re dealing with calf cramps, hamstring seizing, or that sharp side stitch under your ribs, each has a specific cause and a specific fix.

Why Runners Get Cramps in the First Place

For decades, the conventional wisdom was simple: you’re dehydrated, you cramp. But the science has shifted. The leading explanation now centers on neuromuscular fatigue. As your muscles tire during prolonged or intense running, the normal feedback loop that controls muscle contraction breaks down. Your muscle spindles (which tell muscles to contract) become overactive, while the sensors in your tendons (which tell muscles to relax) become less effective. The result is an involuntary, sustained contraction: a cramp.

This explains why cramps tend to strike late in a race, in muscles you’ve pushed hardest, and more often when you’ve run faster or longer than your body is trained for. It also explains why well-hydrated runners still cramp and why dehydrated runners sometimes don’t.

That said, fluid and electrolyte losses aren’t irrelevant. Endurance athletes lose sodium through sweat at some of the highest rates of any sport, and heavy sodium losses can contribute to the conditions that make cramping more likely. The reality is that cramps probably involve both factors, with fatigue playing the bigger role for most runners.

Build Up to Your Goal Distance Gradually

Since fatigue is the primary cramp trigger, the single most effective prevention strategy is training your muscles to handle the workload you’re asking of them. If you cramp at mile 8, your body is telling you mile 8 exceeds your current conditioning. Increasing your weekly mileage by no more than 10 percent per week gives your neuromuscular system time to adapt.

Incorporate longer runs at an easy pace to build endurance in the specific muscle fibers you’ll rely on during races. Add strength work for your calves, hamstrings, and quads, since stronger muscles resist fatigue longer and maintain better neuromuscular control. Hill repeats and tempo runs also teach your legs to perform under stress without short-circuiting. The runners who cramp least are the ones whose training consistently matches or exceeds race demands.

Stay Ahead of Fluid and Sodium Losses

You don’t need to obsess over hydration, but you shouldn’t ignore it either. A practical approach: drink to thirst during runs under an hour, and use a more deliberate strategy for anything longer, especially in heat. Losing more than 2 to 3 percent of your body weight in sweat during a run is the range where performance and muscle function start to suffer.

Sodium matters more than most runners realize. Endurance athletes lose an average of about 1,200 milligrams of sodium per hour through sweat, though individual rates vary widely. If you’re a salty sweater (white residue on your clothes or hat after a run), you’re on the higher end. For runs over 60 minutes, a sports drink or electrolyte mix with sodium is more useful than plain water. For runs over 90 minutes, pairing electrolytes with a fueling plan becomes important.

Fuel Properly on Long Runs

When your muscles run low on glycogen (their stored fuel), they fatigue faster, and fatigue is what triggers cramps. For any run or race lasting more than about 90 minutes, aim to take in 30 to 60 grams of carbohydrates per hour. That’s roughly one to two energy gels, a few handfuls of sports chews, or 16 to 32 ounces of a carbohydrate sports drink.

Timing matters. Don’t wait until you feel depleted. Start fueling 30 to 45 minutes into a long effort and continue at regular intervals. Practice your fueling strategy during training runs so your stomach adapts before race day. Many runners who cramp in the final miles of a half marathon or marathon simply ran out of fuel, which accelerated fatigue and triggered the neuromuscular breakdown that causes cramping.

Warm Up Before You Pick Up the Pace

Jumping into a fast pace on cold muscles is a reliable way to invite cramps. A 5 to 10 minute easy jog before your main effort brings blood flow to your legs and primes your neuromuscular system. Dynamic stretches like leg swings, walking lunges, and high knees prepare your muscles through their full range of motion. This is especially important for speed workouts, races, and cold-weather runs where muscles are stiffer at the start.

Preventing Side Stitches

That sharp pain under your ribs (technically called exercise-related transient abdominal pain) isn’t the same as a leg cramp, but it’s just as disruptive. Side stitches are closely tied to breathing patterns and core stability.

Shallow, rapid chest breathing is a common trigger. When you breathe only into your upper chest, your diaphragm doesn’t move through its full range, and the tissues around it can spasm. Focus on belly breathing: inhale so your stomach expands, then exhale fully. This keeps your diaphragm relaxed and your core muscles oxygenated. It takes practice to maintain deep breathing as your pace increases, but it makes a significant difference.

Eating too much or too close to a run is another common cause. Allow at least two hours after a full meal before running. A strong core also helps, since your abdominal muscles support the organs and tissues that shift during running. Trunk rotation exercises and overhead reaches as part of your warmup prepare the tissues around your diaphragm and reduce stitch risk.

If a stitch hits mid-run, slow down, press your fingers firmly into the painful spot, and take several slow, deep breaths. With each exhale, press a little deeper. You can also raise your arms overhead and lean gently toward the opposite side for about 30 seconds. Most stitches release within a minute or two with these techniques.

What to Do When a Cramp Hits

If a leg cramp strikes during a run, slow down or stop and gently stretch the affected muscle. For a calf cramp, pull your toes toward your shin. For a hamstring cramp, straighten your leg and lean forward at the hips. Hold the stretch for 20 to 30 seconds. Stretching works because it activates the tendon sensors that send a “relax” signal to the cramping muscle, counteracting the faulty nerve firing that caused the cramp.

Pickle juice has gained popularity as a cramp remedy, and there’s some science behind it. The strong, pungent taste appears to stimulate receptors in the mouth and throat that send signals to the spinal cord, reducing the nerve excitability driving the cramp. It works faster than any electrolyte could be absorbed (often within a minute or two), which supports the idea that the effect is neurological rather than nutritional. About 1 milliliter per kilogram of body weight is the amount used in studies, roughly 2 to 3 ounces for most adults. Mustard may work through a similar mechanism, though the evidence is thinner.

Skip the Magnesium Supplements

Magnesium is one of the most commonly recommended supplements for cramps, but the evidence doesn’t support it for runners. A Cochrane review, the gold standard for evaluating medical evidence, found no randomized controlled trials testing magnesium for exercise-associated cramps. The studies that do exist focused on older adults with nighttime leg cramps, and even there, magnesium performed no better than a placebo. Unless you have a diagnosed magnesium deficiency, supplementing is unlikely to prevent your running cramps.

A Quick Checklist Before Your Next Run

  • Train for the distance. Your long run should match or approach your goal race distance in the weeks before the event.
  • Hydrate with electrolytes for runs over 60 minutes, especially in warm weather.
  • Fuel with carbohydrates during efforts over 90 minutes, starting early and staying consistent.
  • Warm up with easy jogging and dynamic stretches before hard efforts.
  • Breathe deeply into your belly rather than taking short, shallow breaths.
  • Strengthen your legs and core so your muscles resist fatigue longer.
  • Don’t race beyond your fitness. Going out too fast relative to your training is the most common cramp trigger on race day.