
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.
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 cramp | Restless legs syndrome | |
|---|---|---|
| What it feels like | Sudden, sharp, locked muscle | Crawling, pulling, itching urge to move |
| Pain | Yes, often intense | Usually uncomfortable, not sharp |
| When | Often wakes you from sleep | Usually while trying to fall asleep or sitting still |
| What relieves it | Stretching the muscle | Moving, walking, shaking the legs |
| Leftover soreness | Common, can last a day | Rare |
If your problem sounds more like the right column, read our guide to restless legs syndrome and sleep instead. The fixes are different.
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.
Idiopathic doesn't mean nothing is contributing. Before you go buy anything, run through this list.
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:
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.
Frequent cramps show up more often with:
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.
When it hits, you want it gone in seconds, not minutes. Here's the sequence that works for most people:
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.
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.
Stopping a cramp is triage. The real win is having fewer of them.
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:
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.
This one's mechanical and costs almost nothing:
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.
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.
This is where most cramp advice falls apart. Here's the honest scorecard.
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.
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 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.
Most night cramps are a nuisance, not a warning sign. Get checked if:
Ask for basic bloodwork: electrolytes, kidney function, thyroid, glucose, and a review of your medication list. That covers most of the treatable causes.
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.
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.
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.
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.
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.
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.
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.