Charley Horses at Night: Causes and How to Stop Them

Nighttime charley horses happen when motor neurons in your legs fire involuntarily during sleep, causing a sudden, painful contraction that can last from a few seconds to several minutes. The problem is remarkably common: 37 to 50% of older adults experience them, and the likelihood increases about 3% with each year of age. Several overlapping factors explain why these cramps strike at night rather than during the day.

Why Cramps Happen During Sleep

When you lie in bed, your feet naturally point downward, a position called plantar flexion. This shortens the calf muscle fibers to near their maximum. In that shortened state, even a small involuntary nerve signal can trigger a full contraction because the muscle has no slack left to absorb it. During the day, you constantly shift positions and bear weight on your feet, which keeps calf muscles stretched and active. At night, you lose that natural movement, and the combination of a shortened muscle and an uninhibited nerve impulse creates the perfect setup for a cramp.

The underlying mechanism involves the motor neurons that control your leg muscles becoming hyperexcitable. Normally, your nervous system keeps these signals in check. But when certain conditions are present (dehydration, mineral imbalances, fatigue, or nerve irritation) the threshold for firing drops, and motor neurons discharge spontaneously. The result is an intense, involuntary contraction you can’t override until the nerve signal finally exhausts itself or you physically stretch the muscle.

Dehydration and Electrolyte Imbalances

Your muscles depend on a precise balance of minerals to contract and relax properly. Sodium, potassium, magnesium, calcium, and chloride all play roles in transmitting nerve signals and releasing muscle fibers after a contraction. When you’re low on fluids or sweating heavily before bed, the concentration of these minerals shifts in the fluid surrounding your nerve endings. That shift can make nerves fire more easily, triggering cramps.

People who exercise in the evening, drink alcohol before bed, or simply don’t drink enough water during the day are especially vulnerable. Hot weather compounds the problem by increasing fluid and mineral loss through sweat. If your cramps tend to be seasonal, peaking in summer months, dehydration is a likely contributor.

Medications That Increase Risk

Three classes of prescription drugs have the strongest links to nocturnal leg cramps: diuretics (water pills), statins (cholesterol-lowering drugs), and long-acting inhaled bronchodilators used for asthma or COPD. A large study published in JAMA Internal Medicine found that people starting inhaled bronchodilators were about 2.4 times more likely to need cramp treatment afterward. Potassium-sparing diuretics roughly doubled the risk, and thiazide-type diuretics increased it by about 48%. Statins showed a smaller but still measurable association.

Diuretics are a logical culprit because they increase urine output, depleting the very minerals your muscles need. Statins can cause muscle-related side effects more broadly. If you started a new medication in one of these categories and your nighttime cramps worsened, the timing is probably not a coincidence. Over 60% of people treated for cramps in one study were also taking at least one of these drug types.

Age and Declining Nerve Function

Nocturnal leg cramps become significantly more common after age 50. In population surveys, people in their 50s reported moderate to severe nighttime cramps at roughly twice the rate of people in their 70s or 80s on a proportional basis, partly because the 50-to-59 age group represents a larger share of the population, but the per-person likelihood still climbs steadily with age. By your 60s and 70s, changes in nerve health, reduced muscle mass, and less daily physical activity all contribute.

As you age, you naturally lose motor neurons. The remaining neurons take over more muscle fibers, which means each nerve signal controls a bigger chunk of muscle. When one of these oversized motor units misfires at night, the resulting cramp involves more tissue and feels more intense. Conditions associated with aging, including arthritis, poor overall health, and cardiovascular issues like angina, are independently linked to more frequent and more severe nighttime cramps.

Circulation Problems and Diabetes

Peripheral artery disease, where narrowed arteries reduce blood flow to the legs, causes muscle pain and cramping that can wake you from sleep. In milder cases, this only happens during walking. But when the condition is severe, the reduced blood supply causes pain even at rest or while lying down. Diabetes is a major risk factor for peripheral artery disease and also damages nerves directly, making spontaneous nerve firing more likely. If your nighttime cramps come with cold feet, slow-healing wounds on your legs, or pain in your calves when walking, poor circulation could be driving the problem.

Pregnancy

Pregnant women deal with a unique combination of cramp triggers. Blood volume increases substantially during pregnancy, putting veins under higher pressure. At the same time, the growing uterus presses on the large veins in the pelvis that return blood from the legs to the heart. This creates a traffic jam of sorts in the leg veins, leading to swelling, varicose veins, and the heavy, achy sensation that often accompanies nighttime cramping. Mineral demands also rise during pregnancy, making electrolyte imbalances more likely. Interestingly, magnesium supplements show a small but measurable benefit for pregnant women with leg cramps, reducing cramp frequency by about one episode per week compared to placebo, even though the same supplements don’t appear to help the general population.

What to Do During a Cramp

When a charley horse hits, your instinct may be to tense up or try to “work through it.” Don’t. The goal is to gently lengthen the cramping muscle, which overrides the contraction signal. For a calf cramp, the most common type, sit up in bed and loop your blanket or a towel around the ball of your foot. With your knee straight, gently pull your toes toward you. This forces the calf to stretch and interrupts the spasm.

If the cramp is in the front of your lower leg (the shin area), stand at the side of the bed, put your weight on your toes, and lift your heels. For a hamstring cramp in the back of your thigh, sit on the floor with your legs extended and slide your hands down your legs until you feel a stretch in the cramped area. Hold for about 30 seconds. For back cramps, a child’s pose position (kneeling with your arms extended forward on the floor) works well.

The key in all cases is gentle, sustained pressure. You’re not trying to force the muscle into submission. You’re giving the nerve signal a competing input that tells the muscle to release.

Reducing Cramp Frequency

Since multiple factors usually contribute, addressing just one may not eliminate nighttime cramps entirely, but a few strategies have the best track record. Staying well hydrated throughout the day, not just at dinner, keeps electrolyte concentrations stable in the fluid around your nerves. A brief calf stretching routine before bed, holding a wall stretch for 30 seconds on each side, counteracts the muscle shortening that happens when you lie down.

Sleeping with your feet in a neutral position rather than pointed helps too. Some people achieve this by untucking the sheets at the foot of the bed, which removes the weight of blankets pushing the feet downward. Others prop a pillow at the foot of the bed to keep their feet from dropping into full plantar flexion.

Despite their popularity, magnesium supplements have limited evidence behind them for most people. A meta-analysis of seven randomized controlled trials found no meaningful reduction in cramp frequency for non-pregnant adults taking magnesium compared to placebo, and gastrointestinal side effects were slightly more common in the supplement group. If you suspect a true magnesium deficiency (common in people who take diuretics or eat a highly processed diet), correcting it through food sources like nuts, seeds, leafy greens, and whole grains is a reasonable first step.

Regular physical activity during the day, particularly walking and low-impact exercises that keep calf muscles conditioned, helps maintain healthy nerve-muscle communication and reduces the hyperexcitability that triggers spontaneous cramps at night.