Skip to content
Competition advice

How to Avoid Cramps During a Marathon? 5 Tips

How to Avoid Cramps During a Marathon? 6 Tips

Are you training for a marathon? Cramps are one of the scenarios many marathoners dread, whether you are aiming for 3 hours or 4 hours. They often strike in the last 10 km, in the hamstrings, calves or quads. The good news: to avoid cramps during a marathon, you have far more control over your pacing and muscle preparation than over your water bottle.

The short answer

  • In the marathon, cramps are mainly linked to muscle fatigue: starting too fast and under-prepared legs are the prime suspects.
  • Studies show no clear link between cramps and dehydration or salt loss in most runners.
  • Strength training and long runs with marathon-pace segments prepare your legs to last 42.2 km.
  • If you have cramped in races before, your risk is higher: be even more careful with your starting pace.
  • If a cramp hits: slow down, walk for a few seconds, gently stretch the muscle, then build back up gradually.
Contents
  1. What is an exercise-associated muscle cramp?
  2. Why do you get cramps during a marathon?
  3. 5 tips to avoid cramps during a marathon
  4. What to do if you cramp during a marathon
  5. Prepare your muscles to run a marathon without cramps with RunMotion Coach
  6. FAQ: cramps and the marathon

What is an exercise-associated muscle cramp?

A cramp is an involuntary, painful contraction of a muscle or muscle group. It comes on suddenly and can last from a few seconds to several minutes.

In the marathon, there is the real cramp, when you are doubled over in pain and have to stop, and the “near-cramp”: you feel the muscle stiffen, tighten and start contracting abnormally. That is the stage where you can still act. Night cramps can also occur the night after the race, in very tired muscles.

Why do you get cramps during a marathon?

Neuromuscular fatigue, the main suspect

The best-supported explanation today is neuromuscular. As a muscle tires, the balance between the nerve signals that make it contract and those that hold it back is disrupted. The muscle ends up contracting without you deciding to (Schwellnus, 2009). That is why cramps rarely strike at km 5 but often after km 30, in the muscles that have been working the longest.

Too ambitious a pace

One study followed 210 triathletes during an Ironman. What set apart those who cramped was neither their level of dehydration nor their blood sodium, but a faster race pace and a history of cramping (Schwellnus et al., 2011). It is an observational study, in triathlon rather than marathon, but the message matches what many runners experience: going out too fast costs you at the end.

Muscle damage from impact

In the marathon, repeated impacts on tarmac gradually damage muscle fibres. A study in marathon runners showed that those who cramped had higher markers of muscle damage at the finish than the others (Martínez-Navarro et al., 2020). Legs used to the distance and the impact are therefore better prepared.

What about dehydration and electrolytes?

They cannot be ruled out completely, especially in strong heat (above 25°C) or high humidity. But in a marathon run in normal conditions, they are usually not the deciding factor. A literature review concludes that exercise-associated cramps probably have several causes, and that hydration or electrolytes may play a role in some runners without explaining most cases (Maughan and Shirreffs, 2019).

In trail and ultra running the context changes: downhills, duration, heat. We explain this in our article on cramps in trail running and ultras.

5 tips to avoid cramps during a marathon

1. Start at the right pace

This is the simplest tip and probably the most effective. Set your goal from your recent race times, for example with our race time predictor, and stick to it from the first kilometres. For an amateur runner, a negative split (finishing faster than you started) is hard to pull off: it is common to lose around ten seconds per kilometre after km 30. Banking a little time early on can therefore make sense, but never more than 5 s/km faster than your target pace. Race-day excitement pushes many runners well beyond that. If you have cramped in a marathon before, stay as close as possible to your target pace over the first half.

That is what happened to me at the 2019 New York City Marathon. I went out too fast, despite a disrupted final month of training. From km 30 I had strong pain in my hamstrings, due to that difficult preparation, the fast start (2 minutes too fast at halfway) and a lack of leg strength work. My hamstrings were stiff, on the verge of cramping. Walking for 30 seconds at the last two aid stations to loosen my thighs helped me cross the line in 2:39, just 1 minute off my personal best.

2. Strengthen your legs

Stronger muscles tire more slowly at the same pace. Add one or two marathon strength sessions a week, focusing on hamstrings, calves, quads and glutes. A marked imbalance, for example very strong quads compared with the hamstrings, is often mentioned in runners who always cramp in the same place. Studies have not yet directly shown that strength training prevents cramps, but it is the most logical lever given what we know about muscle fatigue.

3. Get your muscles used to the distance and marathon pace

Your legs need to know the duration of the effort before race day. Lengthen your long runs progressively over your build-up, and add marathon-pace segments once your base is in place. This work prepares your muscle fibres for the repeated impact of the road and limits damage late in the race.

Conversely, avoid doing too much in the final days: a heavy race week puts you on the start line with already tired legs.

Dosing your load and placing the right sessions at the right time is exactly what an adaptive plan does. Try RunMotion Coach free for 7 days to prepare your marathon at your level.

4. Hydrate and fuel without overdoing it

Drink small amounts regularly, at almost every aid station, guided by thirst rather than forcing yourself. In hot weather, pay more attention. Sports drinks are not essential over a marathon distance, but they can help if you tolerate them well. Test them in training, like your gels: carbohydrate intake helps you hold your pace late in the race.

5. Use gear you have already tested

Run in shoes you know and feel good in, and technical clothing you have already worn on long runs. Our marathon gear guide helps you sort it out. Compression socks have not been shown to prevent cramps, but if you feel good in them, nothing stops you wearing them.

What to do if you cramp during a marathon

Learn to recognise the first signs: slight twitches, a muscle that tightens. Slowing your pace by 10–15 s/km is sometimes enough to get your legs back. If the cramp still creeps closer, walk for a few seconds, for example at an aid station, to relieve the muscle. If it sets in:

  • Gently stretch the muscle: for the calf, lean forward with the affected foot behind you and the heel on the ground.
  • Massage the area for a few seconds to help the muscle relax.
  • Start again gradually, alternating walking and running if needed, before settling into a slightly more cautious pace.

Pickle juice, popular among trail runners, relieved electrically induced cramps faster in the lab, through a reflex effect rather than by supplying salt (Miller et al., 2010). In a marathon, there is no need to plan for that kind of trick: pacing remains your best tool.

If you get frequent cramps, including at rest, or pain that persists after the race, talk to a doctor.

Prepare your muscles to run a marathon without cramps with RunMotion Coach

To avoid cramps during a marathon, remember three things: start at a realistic pace, strengthen your legs and get them used to the distance. Hydration matters, but it comes second.

RunMotion Coach training plans help you progress steadily while taking your training load into account. The strength and conditioning module also offers strengthening and stretching exercises to prepare your muscles for long efforts. Some of our users who often cramped in their hamstrings during marathons told us the cramps disappeared with the combined effect of the RunMotion marathon plan and the app’s strength sessions.

FAQ: cramps and the marathon

Why do I cramp from km 30 onwards?

Because your muscles reach the limit of their preparation. Neuromuscular fatigue and impact-related damage build up, especially if you started too fast. Progressive long runs and a realistic starting pace push that moment back.

Does drinking more prevent cramps in a marathon?

Not necessarily. Studies show no clear link between dehydration and cramps in most runners. Drink regularly according to thirst, especially when it is hot, but focus first on pacing and preparation.

Should you take salt or magnesium to avoid cramps?

There is no clear evidence that these supplements prevent exercise-associated cramps in a runner with a balanced diet. If you get frequent cramps, including at rest, talk to a doctor.

What should you do if a cramp hits mid-race?

Slow down or walk for a few seconds, gently stretch the affected muscle, massage it, then start again gradually, alternating walking and running if needed.

Updated on 30 October 2026.

Sources: Schwellnus, Br J Sports Med, 2009 · Schwellnus et al., Br J Sports Med, 2011 · Martínez-Navarro et al., J Strength Cond Res, 2020 · Maughan and Shirreffs, Sports Med, 2019 · Miller et al., Med Sci Sports Exerc, 2010.

Romain Adam
Romain Adam

A 2:32 marathoner and two-time UTMB finisher (27h), Romain shares his experience to help runners of all levels improve and pass on what running has given him.

Get ready for your next race with a personalized training plan

1.2 million runners coached 88% reach their goal

Start your free trial
  • Download RunMotion Coach on the App Store
  • Get RunMotion Coach on Google Play
Start your free trial

7 days free, cancel anytime