A leg cramp at night is a sudden, painful tightening of a muscle, usually in the calf, that wakes you up. Most nighttime cramps are harmless and pass within minutes. They happen when a tired or shortened muscle gets a stray signal from its nerve. Stretching the muscle usually stops one, and a nightly stretch may make them less frequent.

Frequently asked questions

What causes leg cramps at night?

In most cases, no single cause can be found. Doctors call these cramps idiopathic, which means they happen without an identifiable disease behind them. The current understanding is that they are mostly a nerve problem rather than a nutrition problem. A muscle that is tired, shortened, or held in one position for hours becomes easier to trigger. Then a small burst of nerve activity locks it into a hard contraction. Age, a hard day of walking or standing, a long stretch of sitting, pregnancy, and some medicines can all raise the odds. Dehydration can contribute, especially after heavy sweating, but most people who wake with a cramp are not simply short of one mineral.

How do I stop a leg cramp fast?

Stand up and put weight on the leg, then gently pull your toes toward your shin to lengthen the calf. Hold the stretch for 20 to 30 seconds, breathing slowly, and repeat if the muscle tightens again. Walking a few steps around the bedroom helps too. Massaging the hard knot with your hands, or pressing a warm towel against it, can ease the ache that lingers after the spasm releases. A cold pack works for some people. What matters most is lengthening the muscle, because a cramp is a muscle stuck in its shortest position.

Why do cramps happen more as you get older?

They get more common with every decade past fifty. Tendons naturally shorten with age, so the calf spends more of the night in a shortened position. The number of motor neurons serving each muscle slowly declines as well, which leaves the remaining nerves working harder and, apparently, misfiring more often. None of this means a cramp is a sign of decline. It means the same small triggers that a younger body would ignore are more likely to set off a spasm in an older one.

Does low magnesium cause leg cramps?

Probably not, in most cases. Magnesium is the remedy people hear about first, and it is the most carefully studied. A Cochrane systematic review, which pools the best available trials, found that magnesium supplements made little or no difference to cramp frequency or severity for most adults with ordinary nighttime cramps. The evidence suggested a possible small benefit during pregnancy, which is a different situation. The honest reading is that a cramp does not prove a deficiency, and a supplement does not fix a problem that is mostly about nerve signalling and muscle position. Our guide to magnesium and sleep looks at what the research actually supports.

Are leg cramps at night a sign of something serious?

Usually not. Roughly six in ten adults have had a nighttime leg cramp at some point, and most of them have no underlying disease. But some patterns deserve a conversation with a doctor. Cramps that come often, are severe, or keep returning after weeks of stretching and self care are worth mentioning. So are cramps that come with swelling, redness, skin changes, or muscle weakness, cramps in a leg that also hurts when you walk, and cramps that start soon after a new medicine. These are reasons to get checked, not diagnoses.

How are leg cramps different from restless legs?

They feel different and they behave differently. A cramp is a sudden, painful contraction. You can feel the muscle turn hard under your hand, and it usually eases within minutes of stretching. Restless legs is an urge to move, with crawling or tingling sensations, that shows up when you are resting in the evening and eases when you walk around. It is uncomfortable rather than sharply painful, and it comes back as soon as you lie still again. The two can both ruin a night, but they are not the same problem, and they are not handled the same way.

What actually happens when a cramp hits

A cramp, often called a charley horse, is an involuntary contraction that the muscle cannot release on its own. The calf is the usual site, but the foot and the thigh can cramp too. The muscle goes hard and knotted, the pain is sharp, and the spasm can last from a few seconds to about ten minutes. A dull ache often stays behind for hours, and the muscle can feel tender the next day. That soreness is normal. It is the muscle recovering from a hard contraction, the way a muscle feels after an unexpected workout.

The old story was that cramps come from a missing mineral, usually magnesium or potassium. The newer picture is different. Research now points to the nerve that controls the muscle. When a muscle is fatigued, its nerve becomes more excitable, and the protective reflex that would normally interrupt a spasm fires too late. Think of it as a false alarm the muscle obeys. The pain is real, but the trigger is a misfiring signal, not a hole in your diet.

Why night, of all times

Night is when the calf is at its shortest. Lying down lets your feet drift into a pointed toe position, which anatomists call plantar flexion. In that position the calf muscle sits at its shortest length. A shortened muscle gives its nerve less slack. Even a small burst of stray activity can lock it into a full contraction, because the stretch reflex that would normally stop a spasm barely gets a chance to fire. That is why the same muscle that behaved all day can seize at 3 a.m. Sleeping position shapes more than cramps. Our guide to the best sleeping position looks at how each position treats the legs, back, and neck.

Fatigue stacks the deck further. A day of unusual exertion, a long hike, a first weekend of gardening, or hours standing on a hard floor leaves the motor nerves more excitable by evening. Curiously, the opposite extreme does the same thing. Prolonged sitting shortens the calf muscle and tendon over time, which is one reason desk workers are not spared. Tight bedding adds a third push. A heavy blanket tucked firmly over the feet holds them in the pointed position all night, which is the exact posture that invites a cramp.

The usual triggers

Most nighttime cramps have no single cause, but a few patterns show up again and again.

Age is the strongest. About six in ten adults report a nocturnal leg cramp at some point, and the share rises with age. Children and teenagers get them too, about seven in a hundred, but they are far less common before middle age.

A hard day matters. Unusual exercise, a long walk, a day on your feet, or a new workout can all leave the calf primed to cramp that night. So can a day spent mostly sitting, which keeps the muscle short and still for hours.

Pregnancy is a well known trigger, especially in the second and third trimester. The reasons are not fully settled, and cramps in pregnancy deserve their own conversation with a doctor rather than a home remedy.

Some medicines list cramps as a side effect, including diuretics, which increase urination, statins, and some blood pressure medicines. If cramps started soon after a new prescription, that is worth mentioning to the doctor who prescribed it rather than stopping the medicine on your own.

Dehydration and heavy sweating can contribute, especially after exercise in heat, a fever, vomiting, or diarrhoea. But the link is weaker than most people assume. Fluid helps when the body is genuinely short of it, and it does not fix cramps that come from nerve excitability or position.

A few conditions raise the odds as well, including diabetes with nerve damage, kidney or liver disease, and circulation problems in the legs. These are reasons to get checked, not reasons to panic. Most people with a nighttime cramp have none of them.

How to stop a cramp in the moment

Do not try to wait it out lying still. A cramp is a muscle stuck short, so the fastest fix is to make it long again.

Stand up and put your weight on the cramping leg. Gently pull the toes of that foot toward your shin, or press the ball of the foot against the wall or the floor, and hold for 20 to 30 seconds. If the muscle grabs again when you let go, repeat the stretch. Walking a few slow steps around the room often finishes the job.

Massage helps once the worst of the spasm has passed. Knead the hard knot with both hands until the muscle softens. A warm towel or a warm shower can relax the area, and some people prefer a cold pack instead. Use whichever feels better.

After the cramp releases, stay up for a minute or two. Give the muscle a gentle stretch before lying down again, and loosen the covers at the foot of the bed so your feet are not pinned in a pointed position. The ache that remains is normal and usually fades by morning.

What may make them less frequent

There is no guaranteed cure, and anyone who promises one is selling something. But a few low cost habits have the best support behind them.

Stretch the calves before bed. Stand facing a wall, put one foot back with the heel on the floor, and lean in until you feel a gentle pull in the calf. Hold for 30 seconds on each side and repeat twice. Do it every evening, not only on nights after a hard day. Consistency matters more than intensity, and a hard stretch can itself trigger a cramp, so keep it gentle.

Keep the bedding loose at the feet. Untuck the covers at the bottom of the bed, or let your feet rest near the edge of the blanket, so they can fall into a neutral position instead of being held pointed all night. If you sleep with a heavy blanket, that one change alone is worth trying.

Move during the day. Regular walking and gentle calf strengthening keep the muscle and its nerve in better working order. The goal is to avoid the two extremes that invite cramps, a day of sudden overexertion and a day of almost no movement.

Drink normally. Staying hydrated through the day is sensible, and it matters most after sweating or illness. But forcing extra water at bedtime will not stop cramps, and it will probably wake you for the bathroom instead. Our guide to waking at 3 a.m. covers what to do when the night is already broken.

What does not help

Bananas are the classic advice, and they are mostly a myth. No trial has tested bananas for nighttime cramps, and reviews of the evidence find no proven link between low potassium and ordinary night cramps. A banana is a fine snack, but it is not a treatment.

Magnesium pills are the other common suggestion, and the evidence is disappointing. As noted above, the Cochrane review found little or no benefit for most adults. The supplement industry keeps selling the idea because cramps are common and the story is simple. Simple is not the same as true. If you already take magnesium for another reason, there is no need to stop, but taking it for cramps alone is unlikely to change anything.

Quinine deserves a warning. It was once prescribed for cramps, but it is no longer recommended for this use. Regulators in the United States warned against it because of rare but serious side effects, including low blood platelets and heart rhythm problems. Tonic water contains only a small amount, and it is not a treatment either.

When to get checked

Most nighttime cramps need nothing more than stretching and patience. But a few signs mean it is time to talk to a doctor, and it is better to go sooner than to keep guessing.

Get checked if cramps are frequent or severe, if they keep coming back after several weeks of regular stretching, or if they regularly break your sleep night after night. Go sooner if a cramp comes with swelling, redness, warmth, or skin changes, if the muscle feels weak afterward, if the leg also hurts when you walk, or if cramps began soon after starting a new medicine. Mention pregnancy, diabetes, kidney trouble, or circulation problems if any of those apply. This article is general information, not medical advice, and a doctor who can examine the leg is the right person to sort out what is ordinary from what needs attention.

Getting back to sleep after a cramp

A cramp breaks the night in two ways. The pain wakes you, and then the alertness keeps you awake. The second part is often the longer one. The muscle may be calm, but your body is now wide awake in the dark, listening for the next spasm.

Give yourself a few minutes before trying to sleep again. A slow stretch, a short walk, and a sip of water are enough. Then lie down in a dark, quiet room and let your breathing slow. Even a dim hallway light or a phone screen tells the brain the night is over. A gently weighted wraparound sleep mask blocks that light without pressing on the eyes, and it can help the room feel like night again after an interruption. It will not stop cramps, and it is not a treatment for them. It only handles the light, which is the one part of the wake up that a mask can actually fix. Our guide to sleeping positions covers how to lie down without putting the calf back into its shortest position.

A calmer way to think about them

A leg cramp at night feels alarming, especially the first few times. A muscle you cannot control suddenly turns to stone, and the pain is sharp enough to make you sit bolt upright. But the numbers are reassuring. About six in ten adults have had one, most cases have no disease behind them, and the spasm usually passes within minutes. The useful response is practical. Stretch the muscle, loosen the bedding, and keep the nightly stretch a habit. If cramps become frequent, severe, or come with other symptoms, get checked. A cramp is not the only thing that can greet you in the morning. A stiff neck and an aching back have their own causes, and both are covered in their own guides. Otherwise, treat a cramp as what it usually is, a wiring quirk in a tired muscle, and go back to sleep.

Latest Stories

View all

A woman reads in bed under a warm wall-mounted lamp.

How to Read in Bed Without Waking Your Partner

Before buying a book light, try a quick check for the bulb, the open page and the glow that moves when you turn a page.

Read moreabout How to Read in Bed Without Waking Your Partner

Why Do I Wake Up With My Heart Racing? What It Means and What Helps

Why Do I Wake Up With My Heart Racing? What It Means and What Helps

Waking up with your heart racing is usually your stress response firing at the wrong moment. A dream, a noise, or a dip in oxygen snaps your body awake, adrenaline surges, and your heart pounds for a minute or two....

Read moreabout Why Do I Wake Up With My Heart Racing? What It Means and What Helps

Man lying on his back with his eyes closed on a gray pillow, wearing a cream-colored textured shirt.

Sleep Mask for Back Sleepers

For back sleepers, a sleep mask should keep pressure off your eyes, sit evenly without a tight strap, and feel comfortable where the back meets your pillow.

Read moreabout Sleep Mask for Back Sleepers