What to Do for Leg Pain at Night: Causes and Relief

Nighttime leg pain usually responds to a few simple interventions you can try right now: stretching the affected muscle, adjusting your sleeping position, and loosening your bedcovers. But the best approach depends on what’s actually causing the pain, because “leg pain at night” can mean anything from a harmless charley horse to a circulation problem that needs medical attention. Here’s how to sort it out and find relief.

Figure Out What Kind of Pain You Have

The two most common causes of nighttime leg discomfort are nocturnal leg cramps and restless legs syndrome, and they feel quite different. Nocturnal leg cramps hit as sudden, painful contractions, usually in the calf, that lock the muscle for seconds to minutes. You can often feel the knotted muscle under your skin. Restless legs syndrome, by contrast, isn’t really painful in the traditional sense. It’s an uncomfortable urge to move your legs that builds when you’re lying still in the evening, and moving temporarily relieves it.

A third possibility is poor circulation. Peripheral artery disease typically causes cramping during activity that stops with rest, but in more advanced cases the pain can show up when you’re lying down too. Coldness in one foot compared to the other, weak pulses in the legs, or numbness are signs that blood flow is the issue. This type of pain warrants a medical evaluation rather than home remedies.

How to Stop a Cramp in the Moment

When a cramp strikes, stretch the muscle immediately. For a calf cramp, straighten your leg and pull your toes toward your shin. For a thigh cramp, pull the foot on that side up toward your buttock (grab a chair or the bed frame for balance). Hold the stretch until the contraction releases, then gently massage the area. Applying a warm towel or heating pad afterward can help relax any lingering tightness.

Walking around for a minute or two once the cramp loosens also helps reset the muscle. The goal is to lengthen the fibers that just involuntarily shortened, so resist the temptation to stay curled up in bed guarding the leg.

Stretches That Prevent Cramps Before Bed

A short stretching routine before sleep can reduce how often cramps happen. The Cleveland Clinic recommends a simple wall stretch for the calves: stand about three feet from a wall, lean forward with your arms outstretched and palms flat against the wall, keeping your feet flat on the floor. Hold for a count of five, then release. Repeat this for at least five minutes, and try to do it three times a day, with one session right before bed.

Gentle hamstring stretches work well too. Sit on the edge of your bed with one leg extended, toes pointing up, and lean forward until you feel a pull along the back of your thigh. The consistency matters more than intensity. A few minutes of mild stretching every night is more effective than one aggressive session per week.

Bedroom Adjustments That Help

Tight bedcovers are an overlooked contributor to nighttime cramps. When a heavy sheet or tucked blanket pushes your feet into a pointed position, the calf muscles shorten and are more prone to cramping. Loosening the covers at the foot of the bed, or untucking them entirely, gives your feet room to stay in a neutral position. Some people sleep better with the top sheet draped loosely or with no top sheet at all.

Leg elevation can also make a noticeable difference, especially if your legs feel heavy or achy rather than crampy. Placing a wedge pillow or a couple of regular pillows under your calves and ankles so your legs sit about 6 to 8 inches above your heart helps blood flow back toward your chest. The key is creating a gentle, even incline that supports the whole leg. Bending sharply at the knee can actually restrict blood flow and make things worse.

What About Magnesium and Electrolytes?

Magnesium supplements are one of the most popular home remedies for leg cramps, but the clinical evidence is disappointing. A randomized trial published in JAMA Internal Medicine gave adults either magnesium oxide (520 mg of elemental magnesium) or a placebo nightly for four weeks. Both groups saw their cramps decrease by roughly the same amount, about three fewer cramps per week. The magnesium performed no better than the sugar pill.

The broader research picture is similar. The American Academy of Family Physicians notes that nocturnal leg cramps have no proven association with deficiencies in potassium, sodium, magnesium, or calcium. The cramps are likely caused by muscle fatigue and nerve dysfunction rather than electrolyte imbalances. Even diuretics, long blamed for causing cramps through electrolyte loss, haven’t been implicated in evidence-based reviews. This means loading up on bananas or sports drinks before bed probably won’t change your cramp frequency, though staying generally well-hydrated is still a good idea for overall muscle function.

Treatments to Avoid

Quinine, the compound found in tonic water and formerly sold in pill form for cramps, carries serious risks. The FDA has stated that quinine is not considered safe or effective for treating or preventing leg cramps. It’s approved only for treating malaria. The dangers include life-threatening drops in platelet count, dangerous heart rhythm changes, and kidney failure requiring dialysis. Fatalities have been reported. Drinking a small glass of tonic water contains far less quinine than a medicinal dose, but it’s still not an evidence-based cramp remedy.

Signs the Pain Needs Medical Attention

Most nighttime leg pain is benign, but certain patterns point to something more serious. A blood clot in a deep vein (DVT) can cause leg pain, cramping, or soreness that often starts in the calf, along with swelling, skin that turns red or purple, and a feeling of warmth in the affected leg. These symptoms typically affect one leg, not both. If you notice this combination, especially after a period of immobility like a long flight or surgery recovery, get evaluated promptly.

Leg pain that comes with cold or pale skin, weak pulses in the feet, or wounds that heal slowly may signal restricted arterial blood flow. Pain that wakes you from sleep every night and doesn’t improve with stretching or positioning changes also deserves investigation, as it can indicate nerve compression, spinal stenosis, or vascular disease that benefits from targeted treatment rather than home management.