A cramp can wake you at 3 am with a calf as hard as a rock, or stop you halfway through a run. It hurts, but it's usually harmless and over within minutes.1

Here's what a cramp is, what may cause it (it's less settled than you'd think), which popular fixes don't hold up, what to do in the moment, and when to see a doctor. This is general information: if a medical condition or a medicine might be behind your cramps, talk to your GP or pharmacist.

What a cramp is

A muscle cramp happens when a muscle tightens on its own and won't relax, most often in the calves or the backs and fronts of the thighs.2 Leg cramps usually hit the calf, and less often the feet or thighs. A cramp can last from a few seconds to 10 minutes, and the muscle may feel sore for up to 24 hours afterwards. Most people get them at night or while resting.1

Most research on causes looks at cramps during or soon after exercise, while the stretching trials below looked at night cramps.

Why cramps happen: still theories

Often there's no clear reason. The NHS lists ageing, too much strain on muscles during exercise, pregnancy, dehydration, liver disease linked to heavy drinking and some medicines, and notes that the reason for some cramps is unknown.1 MedlinePlus adds overusing or injuring a muscle, an underactive thyroid and kidney failure, among others.2

For exercise cramps, two theories have competed:

  • Dehydration and electrolytes: you sweat out too much fluid and too many minerals, such as sodium, and the muscle misfires.
  • Nerve control: something changes in the way your nervous system controls the muscle, so it contracts and won't let go.

A 2009 review found that support for the dehydration and electrolyte theory came mainly from anecdotes, case reports covering 18 people and one small study of 10, while four prospective studies, which followed athletes forward in time, didn't back it up. The nerve-control theory had more research behind it, though the author said it needs more evidence too.3

A 2022 review went further: exercise cramps probably come from a mix of factors that differ from person to person, not one single cause.4 And a 2026 systematic review of 9 studies following 11,274 people found that the clearest predictor was history: people who'd had exercise cramps before had about 4.4 times the odds of getting them again. There was no consistent link with hydration, training or the other factors tested, although most of the evidence was limited.5

So nobody can yet say for sure why muscles cramp, or promise a quick fix.

Three cramp myths

Myth 1: a banana will stop a cramp

The idea is that cramps come from low potassium, and bananas are rich in it. In one small study, 9 men without a history of cramps cycled for an hour in the heat, then ate no banana, one serving or two. Their blood potassium rose only slightly, stayed within normal limits and took 30 to 60 minutes to change. The researcher concluded that bananas are unlikely to relieve cramps this way and act too slowly to help with one that's happening now, although their direct effect on cramps hasn't been tested.6 The 2026 review even found that people who cramped had higher potassium after their races, not lower.5

Myth 2: cramps mean you need more salt

This is the same electrolyte idea, and the 2009 review found it rests mostly on anecdotes and a handful of cases.3 A cramp on its own doesn't show you're short of salt. People who sweat heavily for hours can lose a lot of sodium, and our guide to electrolytes explains who that applies to. If you've been told to cut down on salt, a cramp isn't a reason to add more.

Myth 3: drinking more water will prevent cramps

The NHS does list dehydration among the possible causes,1 but the prospective studies in the 2009 review didn't support it as the cause of exercise cramps,3 and the 2026 review found no consistent link with hydration.5 The 2022 review gives "drink more fluids" as its example of general advice that's likely to work less well than prevention tailored to the person.4 Keep drinking as usual, and don't expect extra water to switch cramps off.

What to do during a cramp

  1. Stop what you're doing.2
  2. Stretch the muscle gently. Stretching and massaging may ease the pain.1 For the calf, straighten your knee and draw your toes toward your shin. For the back of the thigh, straighten your knee and lean forward a little from your hips. For the front of the thigh, bend your knee and bring your heel toward your bottom. The 2022 review recommends gentle static stretching until the cramp eases.4 Don't bounce or yank.
  3. Stand on it. Standing up and putting your weight on the leg may also help.1
  4. Rub it. Massage the muscle as it lets go.2
  5. Go easy afterwards. The muscle may stay sore for up to 24 hours.1 If a cramp cuts a workout short, don't push through the rest.

Can stretching prevent cramps?

It may help some people, and it's cheap and low-risk, but the evidence is thin.

The NHS suggests regular calf stretches, which may reduce cramps but may not stop them completely. Stand facing a wall with your arms out and your hands just touching it, feet flat and back straight, and lean forward until you feel the stretch in your calves. Hold for 2 or 3 seconds and repeat for 5 minutes, 3 times a day, the last time just before bed.1

A Cochrane review found 3 stretching trials with 201 people, all aged 50 or over. Daily calf and hamstring stretching for 6 weeks may make night cramps less painful in people aged 55 and over, though its effect on how often they happen is uncertain. Calf stretching alone for 12 weeks may make little or no difference to how often they happen, compared with a sham stretch. No one reported side effects, but the evidence on benefits was rated low to very low certainty.7

If you want to try, these demos show the positions:

Our guides use holds of 20 to 30 seconds. If night cramps are your problem, stretch before bed. For a longer routine, see our hip, hamstring and lower back stretches.

For cramps during exercise, too much strain is on the NHS list of causes,1 so build up new or harder training gradually, although we found no trial showing that this prevents cramps.

Quinine isn't a self-help option

In the UK, a GP may suggest quinine tablets if stretching exercises haven't helped, but it isn't suitable for everyone, and the GP will discuss the risks and side effects.1 In the US, the prescribing information for Qualaquin, the quinine medicine approved there, carries a boxed warning: using it to treat or prevent night-time leg cramps may cause serious, life-threatening blood reactions, and with no evidence that it works for them, the risk outweighs any benefit. It's approved only to treat a form of malaria.8 Quinine is a decision for a doctor, not something to try on your own.

When to see a doctor

See a GP if:1

  • leg cramps are disturbing your sleep
  • you also have numbness or swelling in your legs
  • a cramp lasts longer than 10 minutes

MedlinePlus also advises contacting a doctor if cramps are severe, don't go away with simple stretching, keep coming back or last a long time.2

Talk to your doctor or pharmacist, too, if:

  • cramps started after you began a new medicine. The NHS names statins (for cholesterol) and diuretics (water tablets) among the medicines that can cause leg cramps.1 Don't stop a prescribed medicine on your own.
  • you're pregnant, drink a lot of alcohol, or have a thyroid, kidney or liver condition. These all appear among the possible causes.12

Get urgent advice if you have throbbing pain in one leg, usually in the calf or thigh, with swelling, red, blue or darkened skin around the painful area, or swollen veins. These can be signs of a blood clot in a deep vein (DVT). In the UK, ask for an urgent GP appointment or call NHS 111. If you also feel short of breath or have chest pain, call 999 or your local emergency number.9

How to start this week

  1. Learn the three moves: stretch it, stand on it, rub it. Try the calf stretch once now, so it's familiar when a cramp hits.
  2. For night cramps, try calf and hamstring stretches before bed for a few weeks.
  3. Drop the quick fixes. Bananas, extra salt and extra water aren't proven cures, and quinine is a doctor's decision.
  4. Build stretching into your training. The 5-Day Transformation opens every session with 15 minutes of stretching, then 15 minutes of cardio, and has three 40-minute Stretch & Cardio days, so the stretches above fit in easily. Its Legs day includes 8 sets of 30 calf raises, so start light and build up. Follow it in the TrainSmart app, where every exercise has an animated demo and you tick off each set as you go.

A cramp is painful but usually brief. Stretch it, stand on it, rub it, and save your worry for the warning signs above.