BackOctober 30, 202611 min readEmmaCentury

Leg Cramps at Night: Why They Happen and What Actually Stops Them

Nocturnal leg cramps wake you with a calf that has locked itself shut. Here is what is happening in the muscle, how to tell a cramp from restless legs, which remedies have evidence behind them, and the causes worth ruling out.

Updated 2026-10-30Editorial standards
Leg Cramps at Night: Why They Happen and What Actually Stops Them

You're asleep, and then you're not — because your calf has seized into a hard, twisted knot that makes you sit bolt upright and grab your foot. It lasts anywhere from a few seconds to a couple of minutes. When it lets go, the muscle aches for the rest of the night and often most of the next day.

Nocturnal leg cramps are one of the most common reasons people wake up in pain, and one of the least well explained by medicine. If you've searched for answers, you've probably found a dozen confident claims about magnesium, potassium, hydration, and pickle juice, most of which don't hold up when you look at the trials.

So let's go through what's actually known: what a cramp is, why it happens more at night, how to tell it apart from restless legs, what to do mid-cramp, and which of the prevention strategies have evidence.

TL;DR: A nocturnal leg cramp is a sudden, involuntary, sustained contraction of a muscle — usually the calf — that can last from seconds to several minutes. About one in three adults over 60 gets them at least every couple of months. Most cases are idiopathic, meaning there is no underlying disease causing them. Mid-cramp, the fastest relief is a firm passive stretch: straighten the knee and pull your toes towards your shin. For prevention, the evidence is thinner than the internet suggests — magnesium trials in older adults have largely shown no consistent benefit, quinine is no longer recommended because of serious side effects, and stretching before bed is low-risk but modestly supported. The things that genuinely matter are reviewing medications, checking for iron deficiency and thyroid problems, and looking at how much load you're putting through the calves.

YouTube: Related video

What is actually happening during a cramp

A muscle cramp is an uncontrolled firing of the nerve endings inside the muscle, producing a contraction you can't release voluntarily. The muscle shortens and stays shortened. If you touch it, it feels hard and rope-like, and the skin over it can look dented or twitching.

That's different from a muscle that's merely tight. Tightness is a sensation at the end of range. A cramp is an active contraction you can't switch off, and it usually resolves in seconds to a few minutes, either on its own or when you force the muscle to lengthen.

The leading explanations involve a few overlapping mechanisms:

  • Neural hyperexcitability. Nerve endings in the muscle become over-sensitive and fire in bursts, usually where the nerve meets the muscle fibre. This is currently the most widely accepted explanation for ordinary cramps.
  • Fatigue and overload. Muscles that have been worked hard, or held in a shortened position for a long time, are more likely to cramp.
  • Electrolyte and fluid shifts. Dehydration and low sodium, magnesium, or potassium can contribute, though the evidence that correcting them reliably stops cramps is weaker than most people assume.
  • Reduced blood flow. Part of the muscle not getting enough blood is listed among the possible causes of idiopathic cramps.

At night, several of those line up. You're lying still for hours, often with your ankles pointed — which shortens the calf — and your body's fluid balance shifts overnight. You're also not consciously correcting your position, so a calf can sit in a shortened, loaded state for a long stretch of time.

How common are they

More common than most people realise, and strongly age-dependent.

Cleveland Clinic's summary notes that about a third of people over 60 will have a leg cramp at night at least once every two months, and that they're most frequent in older adults. They also happen in younger people, particularly during pregnancy, after unusually hard training, and in anyone who stands or walks a lot for work.

Frequency is the practical dividing line. An occasional cramp after a long hike is a nuisance. Several cramps a week, repeated over months, is worth investigating.

Cramp or restless legs? They're not the same thing

This gets mixed up constantly, and the treatments are different.

Feature Nocturnal leg cramp Restless legs syndrome
Sensation Hard, painful contraction you can feel with your hand An urge to move, often described as crawling, creeping, or pulling
Pain Yes, often severe Usually uncomfortable rather than painful
Duration Seconds to minutes, then release Persists until you move
Relief Forcing a stretch Moving the legs, walking
Timing Can wake you from sleep Usually starts in the evening at rest, before sleep
Muscle feel Tight, knotted, visibly contracting Normal tone, no palpable contraction

A systematic review of diagnostic criteria found that nocturnal leg cramps are best identified by the combination of a sudden, painful, involuntary muscle contraction that resolves with stretching or massage, in the absence of another explanation. If your legs feel like they need to move rather than like they're locking up, the restless legs guide is the better read.

Why the causes are usually not what you think

Most nocturnal leg cramps are idiopathic. That word is doing real work: it means after a workup, no cause is found. It does not mean "you're deficient in something."

There is a list of conditions and drugs associated with more frequent cramps, and it's worth running through if yours are frequent:

  • Pregnancy, especially the second and third trimester
  • Diuretics, which shift fluid and electrolytes
  • Beta-agonists used for asthma
  • Statins, in some people
  • Dialysis and chronic kidney disease
  • Diabetes, particularly with nerve involvement
  • Thyroid disease, especially hypothyroidism
  • Iron deficiency, with or without anaemia
  • Varicose veins and venous insufficiency
  • Alcohol use, which affects magnesium and B vitamins
  • Neurological conditions such as Parkinson's disease and peripheral neuropathy
  • Heavy sweating and high training loads, especially in heat

Two of those deserve specific attention because they're easy to miss and cheap to test: iron and thyroid. If you're getting frequent cramps and you're tired, cold, or have heavy periods, ask for a ferritin and a thyroid panel. Fixing an actual deficiency is one of the few interventions that reliably helps.

What to do in the middle of a cramp

The acute treatment is mechanical, not nutritional. When a cramp hits:

  1. Straighten the knee and pull your toes firmly towards your shin. Use your hand, a towel, or press your foot against the floor or the wall. This lengthens the calf and interrupts the contraction.
  2. Hold it for 10 to 30 seconds, even though it hurts. Releasing too early lets the cramp return.
  3. Then walk it off gently for a minute or two.
  4. Apply heat to the muscle afterwards. A warm shower or a heat pack helps the residual ache.
  5. Don't massage hard into a freshly cramped muscle. Gentle movement first, then light massage.

That sequence works for most people most of the time. It doesn't prevent the next one, but it turns a two-minute ordeal into a thirty-second one.

Prevention: what the evidence supports

This is the frustrating part. Cramp prevention is a field full of confident advice and thin data. Here's an honest breakdown.

Magnesium

Magnesium is the first thing everyone recommends, and the evidence is genuinely mixed. A systematic review and meta-analysis of randomised trials in older adults found no significant benefit of magnesium for nocturnal leg cramps. Some later trials have shown modest effects with specific formulations, and if you have a real deficiency — from diuretics, alcohol, or poor intake — correcting it is worthwhile. But for the average person with normal magnesium levels, magnesium supplements are unlikely to be the answer, and the trials bear that out.

Quinine

Quinine was used for decades and is now discouraged. It has modest effects at best, and it carries risks of low platelets and heart rhythm problems. Regulators have warned against using it for leg cramps, and it should not be self-prescribed.

Stretching before bed

Low-risk and widely recommended. The trial evidence is limited and mixed, but the mechanism is plausible: if you lengthen the calf before sleep and reduce the time it spends shortened, you reduce one of the triggers. Two minutes of standing calf stretch and a hamstring stretch before bed is a reasonable habit for anyone with frequent cramps.

Electrolytes and hydration

Helpful if you're actually losing fluid and salt — hot weather, long training sessions, sauna, diuretics. Not a universal fix. Drinking more water than you need doesn't prevent cramps and does interrupt sleep by sending you to the bathroom. If you sweat heavily, replacing sodium matters more than replacing water alone, which is covered in more detail in the hydration and electrolytes guide.

Compression and warmth

Keeping the calves warm at night helps some people, particularly in colder months. Compression socks are being studied for cramp prevention, and they're low-risk to try.

Load management

Cramps cluster after unusually hard or unusually long training. If yours follow your big days, the fix is in your training week, not your supplement shelf. Reduce the spike, warm up properly, and don't stack a hard session onto a dehydrated day.

Medication review

If you take a diuretic, a statin, or an asthma inhaler and your cramps started around the same time, that's a conversation for your doctor. Never stop a prescribed medication on your own, but do raise it.

What the evidence says overall

An evidence-based review of symptomatic treatment for muscle cramps by the American Academy of Neurology's therapeutics and technology assessment subcommittee found that most treatments lack strong supporting evidence, and that the field is hampered by small trials and inconsistent outcome measures.

That's the honest summary: there is no single reliable cure for nocturnal cramps. What works is a combination — mechanical treatment when one hits, correcting any genuine deficiency, reviewing medications, managing training load, and warming and lengthening the calves before bed.

How this shows up in your data

Cramps are invisible to a wearable. The wake-ups they cause aren't.

If you wear a watch to bed, a night with a cramp usually looks like this:

  • More time awake after sleep onset and a lower sleep efficiency score
  • A cluster of brief awakenings in the middle of the night, often at the same time your sleep stages sit in light sleep
  • A heart rate spike during the awakening — heart rate jumps when you sit up in pain
  • A next-day recovery score that doesn't match how the night looked on paper, because the interruption cost you more than the total sleep time suggests
  • A slight rise in resting heart rate the following morning, especially if it happened more than once

If you get cramps regularly, it's worth noting them in your sleep log for a couple of weeks. A pattern with a specific time of night, a specific training day, or a specific bedtime routine is much easier to fix than a vague complaint. Century pulls your overnight heart rate, HRV, and sleep stages into a daily recovery score, so a fragmented night shows up as a dip even when your total sleep hours look fine. That trend is often the thing that makes people realise the "occasional" cramp is happening three nights a week.

When to see a doctor

Book an appointment if:

  • Cramps happen most nights, or several times a night
  • You have muscle weakness, wasting, or numbness alongside them
  • One leg is swollen, warm, or red — this needs urgent assessment to rule out a clot
  • Cramps come on with exercise and ease with rest, especially in the calves or thighs — this can be a sign of narrowed arteries
  • You have diabetes, kidney disease, thyroid disease, or you're pregnant
  • You're losing weight, or have night sweats or fever alongside them
  • You've tried the basics for six to eight weeks with no improvement

The short version

A nocturnal leg cramp is a hard, involuntary contraction, not a sign that your electrolytes are catastrophically off. About a third of adults over 60 get them regularly, and most cases have no identifiable cause. Mid-cramp, force the stretch: straight knee, toes to shin, hold it. For prevention, magnesium and quinine are weaker bets than the internet suggests, while stretching before bed, keeping the calves warm, fixing a real iron or thyroid problem, reviewing your medications, and managing training spikes are the measures that actually move the needle.


Century AI helps you understand your body with a daily health score, recovery score, and sleep insights — using the watch you already wear.

Tagsleg-crampsnocturnal-crampssleepmuscle-healthelectrolytessleep-disruption

Wearable measurements are estimates, not diagnoses. Read Century’s methodology and medical disclaimer.