What Helps Night Leg Cramps: Relief and Prevention

Night leg cramps can often be stopped mid-spasm by stretching the affected muscle, and prevented long-term through simple changes to your sleeping setup, hydration, and evening routine. Most nocturnal cramps hit the calf, though they can also strike the thigh or foot, and they tend to become more frequent with age. The good news is that the most effective interventions are things you can do yourself at home.

Why Cramps Happen at Night

When you lie in bed, your feet naturally point downward. In this position, your calf muscles are shortened as far as they can go. When a nerve signal fires into an already-shortened muscle, the muscle has nowhere to go but into a full, involuntary contraction. That’s the cramp. During the day, regular movement keeps your muscles cycling between contraction and relaxation, which prevents this kind of “stuck” contraction. At night, without that movement, the muscles are vulnerable.

Dehydration plays a compounding role. When your body is low on water, levels of potassium and sodium drop as well. Potassium acts as a messenger between your nerves and muscles. When potassium is low, that communication breaks down, and muscles can get locked in a contracted state. Since most people drink less water in the evening and lose fluid overnight, the conditions for cramping stack up while you sleep.

How to Stop a Cramp Right Now

If a calf cramp wakes you up, straighten your leg and flex your foot, pulling your toes toward your shin. This forces the cramped calf muscle to lengthen, which is the fastest way to break the spasm. Hold the stretch until the cramp releases, then gently rub the muscle. For a thigh cramp, bend your knee and pull your foot up toward your buttock. Holding onto a wall or chair can help you balance if you’re standing.

Deep tissue massage on the cramped muscle can also help it relax. Some people find that walking around for a minute or two after the cramp subsides prevents it from returning. Applying a warm towel or heating pad to the area afterward can ease the residual soreness that often lingers into the next morning.

Bedtime Habits That Prevent Cramps

One of the simplest changes is loosening or untucking your covers at the foot of the bed. Heavy blankets tucked tightly push your feet into that downward-pointed position that shortens the calf and sets the stage for cramping. Sleeping with loose sheets, or letting your feet poke out, keeps your ankle in a more neutral position.

A few minutes of light exercise before bed can also reduce cramp frequency. Riding a stationary bike or walking on a treadmill at a relaxed pace seems to “reset” the muscles and reduce the nerve excitability that triggers cramps overnight. Gentle calf stretches before getting into bed work on the same principle: they lengthen the muscle fibers so they’re less likely to lock up once you’re lying down. Try standing on a step with your heels hanging off the edge and letting your weight slowly stretch each calf for 20 to 30 seconds.

Hydration and Electrolytes

Staying well hydrated throughout the day is one of the most reliable ways to reduce nighttime cramps. But chugging plain water alone isn’t always enough. When you drink large amounts of water without replacing sodium, your blood sodium levels can actually drop too low, a condition called hyponatremia, which brings its own set of problems.

The practical approach is to pair water with foods or drinks that contain potassium and sodium. Bananas, potatoes, avocados, and orange juice are good potassium sources. If you sweat a lot during the day from exercise or heat, a drink with electrolytes can help replace what you’ve lost. Pay attention to your evening fluid intake as well. Cutting off all liquids hours before bed to avoid bathroom trips may leave you mildly dehydrated by the time you’re deep in sleep.

Does Magnesium Actually Work?

Magnesium supplements are one of the most commonly recommended remedies for night cramps, but the evidence is underwhelming for most adults. A Cochrane review, the gold standard for evaluating medical evidence, pooled results from multiple studies of older adults with nocturnal leg cramps and found that magnesium performed no better than a placebo. The difference in cramp frequency was about 10% and was not statistically significant. The percentage of people who experienced meaningful improvement (a 25% or greater reduction in cramps) was identical in the magnesium and placebo groups.

The one population where magnesium may help is pregnant women. Leg cramps are common during pregnancy, and both magnesium supplements and adequate calcium intake (1,000 milligrams per day) are often recommended. The evidence is mixed even here, but the safety profile during pregnancy is generally favorable when taken in standard doses.

Vitamin B Complex

There’s modest evidence that a B vitamin complex may help, particularly in older adults. One study of elderly patients with high blood pressure found that a B complex supplement (including 30 milligrams per day of vitamin B6) led to cramp remission in 86% of treated patients compared to placebo. A review published in the journal Neurology classified B complex vitamins as “possibly effective” for muscle cramps and included them among supplements worth considering. This is a lower tier of evidence than “proven,” but given the low risk of B vitamins, it’s a reasonable option to try.

Medications and Night Cramps

Certain medications can increase your risk of nighttime cramps. Diuretics (water pills) are among the most common culprits because they flush potassium and sodium from your body. Statins, some blood pressure medications, and certain asthma drugs have also been linked to increased cramping. If your cramps started or worsened after beginning a new medication, that connection is worth raising with your doctor.

Quinine, once widely prescribed for leg cramps, is no longer considered safe for this purpose. The FDA has issued multiple warnings about its use for cramps, including a boxed warning on the label. Quinine can cause a dangerous drop in blood platelets, life-threatening allergic reactions, and heart rhythm problems. Fatalities and kidney failure requiring dialysis have been reported. Quinine is approved only for treating malaria, and using it for leg cramps is an off-label use the FDA explicitly advises against.

Who Gets Night Cramps Most Often

Night cramps become more common with age, and most studies focus on adults in their 60s and older. Pregnant women are another high-risk group, especially in the second and third trimesters. People who stand for long periods during the day, those who exercise intensely without adequate hydration, and anyone taking medications that deplete electrolytes are also more prone to them.

For most people, night cramps are uncomfortable but harmless, and a combination of stretching before bed, staying hydrated, keeping covers loose, and paying attention to potassium intake is enough to significantly reduce how often they happen. If cramps are severe, happening every night, or accompanied by muscle weakness or swelling during the day, that pattern suggests something beyond ordinary nocturnal cramps and warrants a closer look from a clinician.