Leg Cramps at Night: Why Your Calf Locks Up While You Sleep and How to Stop It

✍️Sleep Smarter Editorial Team
••11 min read•Last reviewed: October 2026
Person sitting on the edge of a bed at night stretching a cramping calf muscle

Affiliate Disclosure: This article contains affiliate links. If you purchase through our links, we may earn a commission at no extra cost to you. We only recommend products that make practical sense for better sleep.

You're out cold. Then your calf locks into a fist. Your toes curl down, the muscle goes rock hard, and you wake up already grabbing your leg and swearing. It lasts maybe 30 seconds. It feels like five minutes. The next morning your calf still aches like you ran a race you don't remember, and you go to bed that night half-expecting it to happen again.

That's a nocturnal leg cramp, and it's one of the most common reasons adults get jolted awake. A review in American Family Physician puts it at up to 60% of adults who report having them at some point, with frequency climbing after 50. The good news: most cases aren't dangerous, and a few boring habits cut them down a lot. The bad news: some of the most popular "fixes" barely work, and one of them is something the FDA has specifically warned against.

Here's what's actually going on and what to do about it.

What a Night Leg Cramp Actually Is

A nocturnal leg cramp is a sudden, involuntary, painful contraction of a muscle, usually the calf, sometimes the foot or the back of the thigh. The muscle shortens hard and won't let go on its own. You can often see or feel the knot.

That's different from restless legs syndrome (RLS), which people mix up constantly:

Leg crampRestless legs syndrome
What it feels likeSudden, sharp, locked muscleCrawling, pulling, itching urge to move
PainYes, often intenseUsually uncomfortable, not sharp
WhenOften wakes you from sleepUsually while trying to fall asleep or sitting still
What relieves itStretching the muscleMoving, walking, shaking the legs
Leftover sorenessCommon, can last a dayRare

If your problem sounds more like the right column, read our guide to restless legs syndrome and sleep instead. The fixes are different.

Why Cramps Hit at Night

For most people, no single cause ever shows up. Doctors call these "idiopathic" cramps. But the research points to a few things that stack up overnight.

Your foot is pointed for hours. When you lie on your back or stomach, your foot naturally relaxes into plantar flexion, toes pointing away from you. Tight, tucked-in sheets and heavy blankets push it further. That holds the calf muscle in a shortened position all night, and a shortened muscle is easier to set off. This is the leading explanation for why calves cramp in bed and not in the middle of the afternoon.

Nerve signals misfire in a tired muscle. The current best theory is that cramps start in the nerve, not the muscle itself. A fatigued muscle with a shortened tendon sends less "slow down" feedback to the spinal cord, so the motor nerve fires in an uncontrolled burst. That's why cramps cluster after a long day on your feet, a hard workout, or a weekend of yard work.

Age. Muscles and tendons shorten with age, activity drops, and nerve control gets less precise. Cramps are far more common after 50 and very common after 65. Our guide to sleep for seniors covers the other ways sleep shifts in that window.

Sitting all day. Long hours in a chair keep the calves and hamstrings short. Standing on concrete all day fatigues them. Both are linked to more night cramps.

The Hidden Triggers Worth Checking

Idiopathic doesn't mean nothing is contributing. Before you go buy anything, run through this list.

Medications

A large Canadian prescription study by Garrison and colleagues (Archives of Internal Medicine, 2012) looked at which new prescriptions were followed by people starting quinine, a classic cramp drug. That's a sneaky way to find out what's causing cramps. The strongest signals were:

  • Diuretics, especially thiazide-type and potassium-sparing ones (water pills for blood pressure)
  • Long-acting beta-agonists (inhalers like salmeterol and formoterol for asthma and COPD)
  • IV iron sucrose

Statins are also commonly linked to muscle cramps and aches. If your cramps started within a few weeks or months of a new prescription, bring that timeline to your doctor. Don't stop a blood pressure or cholesterol drug on your own, but do ask whether there's an alternative.

Medical conditions

Frequent cramps show up more often with:

  • Pregnancy, especially the second and third trimesters (see our guide to pregnancy sleep)
  • Diabetes and peripheral neuropathy
  • Kidney disease, especially in people on dialysis
  • Liver cirrhosis
  • Peripheral artery disease (cramping with walking that eases at rest is a different, important symptom)
  • Underactive thyroid
  • Low potassium, calcium, or magnesium from vomiting, diarrhea, heavy sweating, or medication

Alcohol

Regular drinking is associated with more frequent night cramps in several studies. Alcohol also wrecks sleep architecture on its own, which our breakdown of alcohol and sleep gets into. If you cramp mostly on nights you drink, that's your experiment.

How to Stop a Cramp in the Moment

When it hits, you want it gone in seconds, not minutes. Here's the sequence that works for most people:

  1. Pull your toes toward your shin. This is the single most effective move. Grab your toes or the ball of your foot and pull back so the calf lengthens. If you can't reach, loop the bed sheet around your foot and pull.
  2. Stand up and put weight on it. Get out of bed, plant the foot flat, and lean forward slightly with the knee straight. Your body weight stretches the calf harder than your hands can.
  3. Walk it off. Ten or twenty steps around the room. Moving the muscle helps it reset.
  4. Massage once it lets go. Knead the calf firmly while it's releasing.
  5. Heat, not ice, afterward. A heating pad on the calf for 15 minutes eases the leftover soreness and helps you relax enough to fall back asleep.

For a hamstring cramp, straighten the leg and lean forward toward your toes. For a foot cramp, pull your toes up and spread them, or stand on the foot.

What about pickle juice?

This one's real, but probably not for the reason people think. A 2010 study in Medicine & Science in Sports & Exercise by Miller and colleagues found that a small shot of pickle juice ended electrically induced cramps about 45 seconds faster than drinking nothing. The relief came too fast for the salt or vinegar to be absorbed into the blood. The likely explanation is a reflex: the sharp taste triggers receptors in the mouth and throat that send a signal to calm the overactive nerve.

That study used young, fit men with cramps triggered on purpose, not older adults with night cramps. But it's cheap and harmless for most people. To try it, keep a few pickle juice shots on the nightstand. Skip it if you're watching your sodium for blood pressure or heart failure.

The Prevention Protocol That Actually Has Evidence

Stopping a cramp is triage. The real win is having fewer of them.

1. Stretch your calves and hamstrings before bed

This has the best non-drug evidence of anything here. A randomized trial by Hallegraeff and colleagues (Journal of Physiotherapy, 2012) put adults over 55 with regular night cramps on a simple stretching routine right before bed. After six weeks, the stretching group had fewer cramps and less severe ones than the control group.

The routine is simple. Do it every night, not just after a bad one:

  • Wall calf stretch: Hands on a wall, one leg back, heel flat, back knee straight. Lean in until you feel the calf stretch. Hold 10 seconds. Then bend the back knee slightly to hit the lower calf. Do 3 rounds per leg.
  • Hamstring stretch: Sit on the edge of the bed, one leg straight out, heel on the floor, toes up. Lean forward from the hips with a straight back. Hold 10 seconds, 3 rounds per leg.

An earlier trial (Coppin, 2005) didn't find a benefit from stretching alone, so this isn't a guaranteed fix. But it's free, it takes four minutes, and it's the best-supported option you have. A slant board makes the calf stretch easier and more consistent. Stand on it while you brush your teeth and you've stacked the habit onto something you already do.

2. Fix your bedding and foot position

This one's mechanical and costs almost nothing:

  • Untuck the sheets at the foot of the bed. Tight hospital corners pin your toes down all night.
  • Lighten the load on your feet. A heavy comforter acts like a weight on your toes. A lighter top layer helps. The Promeed Skinlike silk quilt→ is light, breathable, and doesn't press your feet into a pointed position the way a dense duvet can.
  • Use a blanket support. A bed cradle / blanket lifter clips to the bed frame and holds covers up off your feet. It's a classic hospital fix for exactly this problem.
  • Stomach sleepers: Let your feet hang off the end of the mattress so your ankles stay neutral.
  • Back sleepers: A pillow under the knees and a soft one at the soles can keep your feet from flopping into a point.

If your sleep position changes the frequency, that's a strong clue. Our guide to the best sleeping position covers how to train yourself into a new one.

3. Manage how you load your legs during the day

  • If you sit all day, get up every hour and do 10 calf raises.
  • If you stand on hard floors all day, wear supportive shoes and do the stretching routine both after work and before bed.
  • If you train hard, cramps often follow sudden jumps in volume. Ramp mileage and leg work gradually. Our guide to exercise and sleep covers how training timing affects your night.

4. Drink normally, not heroically

Dehydration gets blamed for every cramp, but the evidence for it causing night cramps in normal people is thin. Drink enough that you're not thirsty and your urine is pale. Chugging a liter before bed mostly gets you up to pee at 2 AM, which trades one wake-up for another.

One cramp-free night doesn't fix a broken sleep pattern. If cramps have trained you to dread bedtime, or you're waking up and lying there for an hour after, the cramp isn't the only problem anymore. The Sleep Reset walks you through rebuilding your schedule, wind-down, and middle-of-the-night routine so one bad wake-up doesn't turn into a wrecked night.

Supplements: What Works and What's Hype

This is where most cramp advice falls apart. Here's the honest scorecard.

Magnesium: probably not for typical night cramps

Magnesium is the first thing everyone recommends. The trials don't back it up for most adults. A 2020 Cochrane review (Garrison and colleagues) pooled the randomized trials and concluded magnesium is unlikely to provide meaningful cramp prevention for older adults with ordinary, idiopathic cramps. A 2017 randomized trial in JAMA Internal Medicine (Roguin Maor and colleagues) found magnesium oxide did no better than placebo.

The evidence in pregnancy is mixed and uncertain. And if a blood test shows you're actually low, or you're on a medication that drains magnesium, correcting it makes sense.

Magnesium can still help some people relax and fall asleep, which is a separate question. Our magnesium for sleep guide covers that. Just don't expect it to end your cramps.

Vitamin K2: early and interesting

A 2024 randomized trial in JAMA Internal Medicine (Tan and colleagues) gave 199 adults over 65 with frequent night cramps either vitamin K2 (as MK-7) or placebo for eight weeks. The K2 group had significantly fewer cramps per week, and the cramps they did have were shorter and less intense. No safety issues showed up.

That's one trial, in one population in China, so it isn't settled. But it's the most promising supplement result in years. If you take warfarin or any blood thinner, do not take vitamin K without talking to your doctor first. It directly interferes with how warfarin works.

Quinine and tonic water: no

Quinine was the classic cramp drug for decades, and it does reduce cramps somewhat. The problem is the side effects. The FDA has warned against using quinine for leg cramps because of serious and sometimes fatal reactions, including dangerous drops in platelets and blood disorders. The benefit isn't worth that risk for a cramp.

Tonic water contains a tiny dose of quinine, far too little to do much. It's mostly a sugary drink before bed. Skip it. B vitamins, vitamin E, and calcium don't have good evidence either.

When to See a Doctor

Most night cramps are a nuisance, not a warning sign. Get checked if:

  • Cramps are happening several nights a week despite stretching and bedding changes
  • They started after a new medication
  • You have swelling, redness, warmth, or pain that doesn't fade in one calf (this can be a blood clot, which is an emergency)
  • You notice muscle weakness, shrinking muscles, or numbness
  • Cramps happen in many muscles, not just the legs
  • You get calf pain while walking that eases when you stop (possible circulation problem)
  • You have diabetes, kidney disease, liver disease, or thyroid problems

Ask for basic bloodwork: electrolytes, kidney function, thyroid, glucose, and a review of your medication list. That covers most of the treatable causes.

The Night Leg Cramp Plan: Short Version

  1. Before bed: Wall calf stretch and hamstring stretch, 3 rounds each per leg, every night for six weeks.
  2. In bed: Untuck the sheets, lighten the covers, keep your feet out of a pointed position.
  3. During a cramp: Toes toward the shin, stand on it, walk, massage, then heat.
  4. During the day: Break up long sitting, ramp workouts gradually, drink to thirst.
  5. Check your meds: Diuretics, inhalers, and statins are common culprits.
  6. Skip: Quinine, tonic water, and expecting magnesium to fix it.
  7. Consider: Vitamin K2, if you're not on a blood thinner, after you've given stretching a real shot.
  8. Get checked: If cramps are frequent, new, one-sided with swelling, or come with weakness.

The Bottom Line

Night leg cramps are common, painful, and usually harmless. They also usually respond to the unglamorous stuff: a four-minute stretch routine, looser sheets, and a look at what you're taking. Give the stretching six weeks and count cramps per week, so you're judging the trend, not last night.

And if the cramps have left you lying awake dreading the next one, fix the sleep, not just the calf.

Frequently Asked Questions

Why do I get leg cramps at night?+

Most night leg cramps have no single cause. The leading explanation is that your foot points toes-down for hours in bed, holding the calf in a shortened position, while a tired muscle sends misfiring nerve signals. Age, long sitting or standing, hard training, alcohol, certain medications, and conditions like diabetes, kidney disease, and pregnancy raise the risk.

How do you stop a leg cramp fast?+

Pull your toes toward your shin to stretch the calf, or stand up and put your weight on the foot with the knee straight. Walk ten or twenty steps, massage the calf as it releases, then use heat for leftover soreness.

Does magnesium help leg cramps at night?+

Probably not for typical cramps. A 2020 Cochrane review concluded magnesium is unlikely to meaningfully prevent ordinary night cramps in older adults, and a 2017 JAMA Internal Medicine trial found magnesium oxide no better than placebo. It makes sense only if bloodwork shows you are actually low.

Does pickle juice work for cramps?+

A 2010 study found a small shot of pickle juice ended induced cramps about 45 seconds faster than nothing. It works too fast to be about salt, so the likely mechanism is a reflex triggered by the sharp taste. It is cheap and harmless for most people, but skip it if you limit sodium.

When should I see a doctor about night leg cramps?+

Get checked if cramps happen several nights a week despite stretching, started after a new medication, come with swelling, redness, or warmth in one calf, involve weakness or numbness, or if you have diabetes, kidney, liver, or thyroid disease. Calf pain while walking that eases at rest also needs evaluation.

Ready to sleep smarter?

Calculate your optimal bedtime in seconds.

Use Sleep Calculator
😴

Sleep Smarter Editorial Team

Our editorial team researches and writes evidence-based sleep content grounded in peer-reviewed science. All articles reference established sleep research from sources including the NIH, AASM, and Sleep Foundation.