Indexed in PubMed · Scopus · MEDLINE ISSN 0946-5448 · Peer-reviewed
Musculoskeletal & Pain Medicine

Leg Cramps at Night: Causes, Fast Relief, and Prevention

Leg cramps — the viselike calf or foot spasms that so often strike at night — are usually harmless but intensely painful. Here is why they happen and how to stop and prevent them.

Person clutching the calf, a common site for painful night-time leg cramps
Most leg cramps grip the calf and strike at night, easing within a minute or two of stretching.

Leg cramps are sudden, involuntary contractions of the muscles in your calf, foot, or thigh — the viselike, knotted pain people nickname a charley horse. One can fade in a few seconds or hang on for several minutes, and they have a cruel habit of striking at night, yanking you out of a dead sleep with a calf like a clenched fist.


ADVERTISEMENT

They're remarkably common. Up to 60% of adults report night-time leg cramps, and roughly three out of four cramps happen during sleep, according to the Mayo Clinic and the Sleep Foundation. This guide walks through why leg cramps happen — the nocturnal kind especially — how to stop one fast when it grabs you, and the daily habits that keep them away.

Sound familiar?

You're asleep. You roll over, your foot points, and your calf locks into a knot so tight it takes your breath away. A moment later you're standing by the bed in the dark, pressing your heel into the cold floor, waiting for it to let go — and it does, after a minute that feels much longer. By morning the calf is tender, as if you ran stairs you don't remember running. If that's you, most nights this is fixable.

What are leg cramps?

A leg cramp is a sustained, involuntary contraction your body won't let go of on command. It usually grips the gastrocnemius and soleus — the two muscles that make up your calf — but it can just as easily seize the small muscles of the foot or the big ones in the thigh. While it has hold of you, the muscle feels clenched into a stone-hard knot, and it often stays sore for hours after.

Nocturnal leg cramps are the classic version: they wake you from sleep, nearly always in the calf or foot. The leading theory is simple — we tend to sleep with our toes pointed down (a position called plantar flexion), which leaves the calf already shortened and primed to misfire. A leg cramp is really a muscle spasm that happens to live in the leg; if instead your muscles ache all over with no single knot, that's more like myalgia. The diagram below shows the calf muscles where cramps tend to strike.

The calf muscles that cramp during a nocturnal leg cramp A side view of the lower leg showing the shin bone at the front, the gastrocnemius and soleus muscles forming the calf at the back, the Achilles tendon running to the heel, and the foot in a pointed, plantar-flexed position. A shaded knot marks where a cramp seizes the gastrocnemius. Gastrocnemius Calf cramp — sustained contraction Soleus Achilles tendon Tibia (shin bone) Foot in plantar flexion (toes pointed)
The calf's gastrocnemius and soleus muscles — and the Achilles tendon — are where night-time leg cramps most often strike.

Leg cramps vs. restless legs syndrome

People often mix up night cramps with restless legs syndrome, but once you've felt both they're hard to confuse — and telling them apart matters, because the fixes are opposite:

FeatureLeg crampRestless legs syndrome
SensationSharp, knotted painCrawling, itchy urge to move
What relieves itStretching the muscleMoving the legs
TimingSudden and briefBuilds up during evening rest
The muscleVisibly tight and hardFeels normal to the touch

Leg cramp symptoms

You won't need a doctor to tell you you're having one. The usual signs:

  • A sudden, intense tightening in the calf, foot, or thigh.
  • A hard, bulging knot you can feel in the muscle.
  • Pain that peaks within seconds and eases as the muscle relaxes.
  • An episode lasting from a few seconds up to about ten minutes.
  • Lingering tenderness in the muscle for hours, sometimes into the next day.
  • Cramps that most often arrive at night or during rest.

Foot cramps can yank the toes down or off to one side, and the arch can lock up too — which sometimes blurs into other causes of foot pain.

Seek urgent care if you notice:

Leg cramps that are severe and frequent; cramps with leg swelling, redness, warmth, or skin changes; numbness or persistent weakness in the leg; cramps that follow exposure to a toxin; or a single muscle that stays cramped for more than about ten minutes. Pair these with a doctor's visit, and treat prolonged or spreading symptoms as urgent.

What causes leg cramps?

Here's the honest part: in most people, no single cause is ever pinned down. Doctors call those idiopathic cramps. Even so, a long list of triggers and conditions can bring them on, usually two or three teaming up at once.

Everyday triggers

  • Muscle fatigue and overuse from exercise, long walks, or standing on hard floors.
  • Prolonged sitting or inactivity, and poor daytime posture.
  • Foot position in bed — sleeping with the toes pointed shortens the calf.
  • Dehydration and the loss of electrolytes such as potassium, magnesium, calcium, and sodium.

Medical causes and medicines

Plenty of health conditions stack the deck: pregnancy, getting older, diabetes, thyroid and kidney disease, peripheral artery disease and sluggish circulation, and nerve problems all raise the odds. A fair few medicines do too — diuretics (water pills), statins, some asthma inhalers, certain blood-pressure drugs. A blood test sometimes turns up low potassium or magnesium. At bottom, a leg cramp is simply a muscle spasm that has set up shop in the leg.

Risk factors

Cramps don't play favourites, but the risk climbs with:

  • Age. About a third of people over 60 get them at least every couple of months, and nearly all adults over 50 experience them eventually.
  • Pregnancy, which affects roughly 40% of expectant mothers, particularly in later trimesters.
  • Female sex — women report cramps more often than men.
  • Intense or unaccustomed exercise and jobs that involve long hours on your feet.
  • Dehydration and diets low in key minerals.
  • Chronic illness — diabetes, kidney, liver, thyroid, or vascular disease — and some medications.

How are leg cramps diagnosed?

There's no scan or blood test that announces “yes, that was a cramp.” The diagnosis comes from your story. Any testing is aimed at the bigger question — is something underneath driving them? — and that only matters when cramps are frequent or severe.

Your doctor will go through your symptoms, medicines, and history, examine the leg, and check your pulses and reflexes. They might order blood and urine tests for electrolytes, kidney and thyroid function, and blood sugar. If the pattern hints at a circulation or nerve problem, vascular studies or nerve conduction tests can come next.

Treatment & fast relief

When a cramp has you, the whole game is to lengthen the muscle and outlast it — most let go within a minute or two. These moves work fastest, roughly in order:

  1. Stretch it. Straighten the leg and pull the toes up toward your shin; for a calf cramp this is the single most effective move.
  2. Stand and load the leg. Put weight on the cramping leg and press the heel into the floor, or walk a few steps on your heels.
  3. Massage the knotted muscle with your hands or a roller to help it relax.
  4. Apply warmth — a heating pad or warm bath loosens the muscle; use ice afterwards for soreness.

For the ache that lingers afterwards, an over-the-counter pain reliever — ibuprofen or acetaminophen — is fine for a day or two; take it with food, and skip the ibuprofen if you have kidney trouble or a sensitive stomach. When cramps are frequent, doctors sometimes trial magnesium or a vitamin B complex, and in selected cases a short course of muscle relaxers. Be clear-eyed, though: no pill reliably prevents cramps, and routine quinine — the old standby — is no longer recommended, because it can cause dangerous heart and blood problems.

MethodHow it helpsWhen to use
Stretch (toes to shin)Lengthens the calf and breaks the crampThe moment a cramp starts
Stand / bear weightForces the muscle to releaseNight-time calf cramps
MassageEases tension and boosts blood flowDuring and after a cramp
Heat, then iceRelaxes the muscle, then calms sorenessDuring the cramp, and after
Hydration & mineralsRestores fluid and electrolytesExercise- or heat-related cramps

Home remedies & exercises

A few minutes of stretching a day genuinely cuts down night cramps — it's one of the best-supported habits going. Hold each of these for 20–30 seconds, and no bouncing; slow and steady is the point.

  1. Wall calf stretch. Stand an arm's length from a wall, step one foot back with the heel flat and the knee straight, and lean forward until the calf pulls. Repeat on both sides, several times a day.
  2. Step heel drop. Stand on a step with the heels hanging off the edge and gently lower them below the level of the step to stretch the calves.
  3. Towel toe stretch. Sit with the leg straight, loop a towel around the ball of the foot, and draw the toes toward you.
  4. Before-bed walk. A few minutes of easy walking or pedalling a stationary bike before sleep loosens the calves.

Tip

If cramps keep waking you, stretch your calves before bed and keep the bedcovers loose — tightly tucked sheets push the toes into the pointed position that sets off night-time calf cramps.

How to prevent leg cramps

Prevention comes down to keeping the muscles loose, watered, and well stocked with minerals:

  • Hydrate through the day, and limit alcohol and excess caffeine, which are dehydrating.
  • Stretch the calves and hamstrings daily, and again before bed.
  • Stay active — regular walking or cycling conditions the leg muscles.
  • Eat mineral-rich foods — bananas, oranges, leafy greens, nuts, dairy, and beans for potassium, magnesium, and calcium.
  • Wear supportive shoes, especially with flat feet, and avoid standing on hard surfaces for long spells.
  • Check your medicines with your doctor if cramps began after a new prescription, and ask whether magnesium is worth trying.

Myth vs. fact

You may have heard…What's actually true
“Night cramps mean you've got a blood clot.”A plain cramp grips and releases within minutes. A clot (DVT) brings steady calf pain with swelling, warmth, or redness that stays — that needs same-day care, but it's a different animal.
“Magnesium cures leg cramps.”It helps some people, mainly in pregnancy, and is low-risk to try — but the trials are mixed and it does nothing for many. Ask first if you have kidney problems.
“A nightly glass of tonic water sorts them out.”That's the quinine idea in disguise. The dose is tiny and unreliable, and quinine's risks are exactly why doctors dropped it for ordinary cramps.

When to see a doctor

The occasional leg cramp is harmless and needs nothing from a doctor. Make an appointment if yours are frequent, severe, or wrecking your sleep week after week, if stretching and the steps above aren't helping, or if they started soon after a new medicine.

Get seen promptly if a cramp comes bundled with leg swelling, redness, warmth, numbness, weakness, or skin changes — those point to a circulation, nerve, or clotting problem rather than an ordinary cramp. And treat it as urgent if a muscle stays locked past about ten minutes, or if cramps follow contact with a possible toxin.

A quick self-check

Before you worry, run your cramps through these questions. A row of “yes” answers points firmly to the ordinary, harmless kind:

  • Does the pain grip and then release within a few minutes, leaving only tenderness?
  • Is it gone by the time you're fully awake, rather than aching steadily all day?
  • Does the calf look normal — no lasting swelling, redness, or warmth on one side?
  • Can you walk and bear weight normally once it passes?
  • Did they start on their own, not right after a new pill or a toxin exposure?

If any answer flips to “no” — especially a calf that stays swollen, red, or warm — book a visit rather than waiting it out.

Key takeaways

  • Leg cramps are sudden, often night-time contractions of the calf, foot, or thigh, affecting up to 60% of adults.
  • Common triggers are muscle fatigue, dehydration, low electrolytes, poor circulation, pregnancy, and the toes-pointed sleeping position.
  • The fastest relief is to stretch the calf by pulling the toes toward the shin, stand and bear weight, then massage and warm the muscle.
  • Daily calf stretches, good hydration, and a mineral-rich diet prevent most cramps; see a doctor for frequent, severe, or one-sided symptoms.

Frequently asked questions

Why do I get leg cramps at night?

Night-time leg cramps are thought to come from lying with the toes pointed, which shortens the calf muscle, combined with reduced blood flow and inactivity during sleep. Dehydration, daytime overuse, and some medicines add to the risk.

How do I stop a leg cramp immediately?

Straighten your leg and pull your toes up toward your shin to stretch the calf, then stand and press your heel into the floor. Massaging and warming the muscle helps it release, usually within a minute or two.

What deficiency causes leg cramps?

Low levels of potassium, magnesium, calcium, or sodium are the deficiencies most often associated with leg cramps, because these minerals regulate muscle contraction. Dehydration commonly makes the shortfall worse.

Does magnesium help with leg cramps?

Magnesium helps some people, particularly during pregnancy, and is low-risk to try, but the evidence is mixed and it does not work for everyone. Ask your doctor before starting a supplement, especially if you have kidney problems.

Are night leg cramps a sign of something serious?

Usually they are harmless. However, frequent or severe cramps, or cramps with leg swelling, numbness, weakness, or skin changes, can point to circulation, nerve, thyroid, or kidney problems and should be checked by a doctor.

How can I prevent leg cramps while sleeping?

Stretch your calves before bed, stay well hydrated, keep bedcovers loose so your toes are not forced downward, and eat a diet rich in potassium, magnesium, and calcium. Regular daytime walking also conditions the muscles.

References

  1. Mayo Clinic. Night leg cramps — symptoms and causes. mayoclinic.org
  2. Cleveland Clinic. Leg cramps. my.clevelandclinic.org
  3. MedlinePlus. Muscle cramps. U.S. National Library of Medicine. medlineplus.gov/ency/article/003193.htm
  4. Sleep Foundation. Leg cramps at night: tips to reduce discomfort. sleepfoundation.org
  5. Healthline. Leg cramps at night. healthline.com
  6. Allen RE, Kirby KA. Nocturnal leg cramps. American Family Physician. 2012;86(4):350–355. aafp.org

Published March 4, 2026 · Last medically reviewed September 22, 2026.