If painful leg cramps wake you up in the middle of the night, you’re not alone—far from it. Up to 60 percent of adults say they’ve experienced leg cramps at night, according to a 2012 study in American Family Physician.
These ill-timed charley horses—characterized by a sharp muscle contraction that can last several seconds to minutes—usually affect the calf and foot, although they can also strike your hamstring. While we’ve all experienced a leg cramp at one point or another, they appear to be more common after age 50, shows a 2017 study in BMC Family Practice.
“You will find plenty of disparate opinions, but the simple truth is that nobody really knows why these [leg cramps] occur,” says Scott Garrison, MD, Ph.D., an associate professor of family medicine at the University of Alberta who has published multiple studies on nocturnal leg cramps.
There are theories, however. Here are some possible why your legs won’t stop cramping up—and what you can do to find relief.
What Are The Possible Causes Of Leg Cramps?
One or several of the factors below—combined with your individual physiology—could explain why you’re waking up in the middle of the night in pain.
1. Not Stretching Certain Muscles
Some researchers have theorized that our modern lifestyle is to blame. While our ancient ancestors spent lots of time squatting—a position that stretches leg tendons and muscles—contemporary life has mostly removed the need for it. There’s also evidence that our mostly sedentary lifestyles (spending big chunks of time sitting or not moving) decrease muscle and tendon length and limberness, which may lead to cramping.
2. Sleeping In An Awkward Position
Other experts have observed that, when lying face down in bed, the foot is often in a “plantar flexion” position—meaning the toe points away from you, shortening the calf muscles. When the foot rests in this position for long periods, even small movements of the feet could trigger a cramp. Sleeping on your side, with your feet off the bed, or in some other position that keeps your toes neutral—not pointing away from you—may be a better position for these muscles.
3. Changing Seasons
Dr. Garrison’s own research has shown nighttime leg cramps are more common in summer than in winter. While not true for everyone, the frequency of these cramps tends to peak in mid-July and crater in mid-January. It’s important to understand that these muscle cramps are caused by nerve issues—not muscle disorders, Dr. Garrison says. Electromyogram tests have shown that nerves running from the spine down to the calf trigger these cramps.
So why summer? “Nerve growth and repair might be more active in summer because of the greater vitamin D levels,” Dr. Garrison explains. Your body produces vitamin D from sun exposure. And so in summer, when your D levels are peaking, your body may engage in “sped up” neural repair, which could trigger these cramps, he says.
There’s some evidence that dehydration promotes nocturnal cramping. “There is a clear seasonal pattern in the frequency of muscle cramps, with higher numbers in summer and lower numbers in winter,” says Michael Behringer, MD, Ph.D., a professor of sports science at Goethe University in Germany. “This suggests that heat and possibly also fluid balance have an influence on the development of cramps.” Dehydration may promote electrolyte imbalances in the blood, which could be one cramp trigger.
5. Really Tough Workouts
Hard exercise has long been linked to muscle cramps. “Skeletal muscle overload and fatigue can prompt muscle cramping locally in the overworked muscle fibers,” write the authors of a study in the journal Current Sport Medicine Reports. This happens even among highly trained professional athletes, the study authors say. While staying hydrated may help, there’s no well-established method for preventing these kinds of overuse cramps.
6. Nutrient Deficiency
There’s evidence—although much of it is mixed—that calcium, magnesium, and potassium imbalances play a part in cramping. Each of these electrolytes helps maintain fluid balance in the blood and muscles, and so it makes some sense that, if they’re out of whack, cramping may ensue. But again, studies have been inconsistent, so more research needs to be done to know how these nutrients affect cramping directly.
7. Standing All Day
There’s also research showing that people who spend a lot of time each day standing are more likely to experience leg cramps than sitters. When you’re on your feet but not in motion, blood and water tend to pool in your lower body. This may lead to fluid imbalances, as well as muscle and tendon shortening—all of which could lead to cramping.
Another of Dr. Garrison’s studies links diuretics (high blood pressure meds like Clorpres and Thalitone, for example, have diuretic effects) and asthma drugs (specifically, long-acting beta-adrenoceptors, or LABAs) to a greater risk for nocturnal cramping. It’s possible these drugs have a “stimulatory” effect on motor neurons and receptors, which could promote cramping, his study concludes.
Pregnancy, too, is associated with more frequent leg cramps, possibly due to weight gain and disrupted circulation. It’s also possible that the pressure a growing fetus places on the mother’s blood vessels and nerves causes cramping, according to the American Pregnancy Association.
10. Certain Health Conditions
Diabetes, hypertension, arthritis, neurological disease, and depression are all associated with leg cramping, too. In some cases, medications could be to blame, as mentioned above. But some of these conditions—namely diabetes and neurological disease—can cause disrupt or even kill your nerves, which may lead to cramping, research shows.
Aging might also play a role in leg cramping, Dr. Garrison says. “It is around the same time that we start losing our motor neurons”—roughly, our early 50s—“that rest cramps start to get more common,” he explains. Both strength and balance exercises may help maintain muscle and nervous system functioning in ways that prevent these issues, research suggests.
How To Prevent And Get Rid Of Leg Cramps
Dr. Garrison says that, for many years, quinine pills were the go-to treatment for leg cramps. And while they provided “a modest benefit,” he says, they also caused some dangerous side effects like an irregular heartbeat. That’s why the FDA advises people to steer clear of the drug to treat leg cramps.
It’s really all trial and error. Since there is no definitive cause of nighttime leg cramps, there’s also no sure remedy. You could speak to three different doctors, and all three might give you a different explanation—and a different remedy. Here are a few worth considering:
✖️ Stretch It Out
While the research on stretching goes back and forth, a small 2012 study did find that people who completed hamstring and calf stretches just before bed enjoyed a significant drop in spasm frequency.
And if you’re in the midst of a spasm? “Stretching the affected muscle while you cramp helps abort a cramp,” Dr. Garrison says. If your cramp is in your lower leg or foot, try a standing calf stretch. If the cramp is in your upper leg, these hamstring stretches may help.
✖️ Eat A Balanced Diet
Ensuring you have plenty of magnesium in your diet—a mineral many Americans don’t get enough—may be beneficial. Beans, nuts, whole grains, and leafy greens are all great sources. (Some research shows that this may not be helpful for everyone, though, so make sure you talk to your doctor before you make any major diet changes.)
One small study found taking B vitamin supplements could help, too. That’s not enough evidence to warrant popping a new pill, but eating more fish, whole grains, and vegetables certainly don’t hurt.
✖️ Stay Hydrated
You could also try to drink more water during the day—especially if you’re sweating or exercising. Dry mouth, headaches, fatigue, and dry skin are all signs that you’re not drinking enough water. The color of your urine is probably your best guide. If your pee is pale yellow or clear, you’re drinking enough H2O. If your urine is dark yellow (or closer to amber), you need to drink more.