Why Do I Keep Getting Charley Horses in My Legs?

Recurring leg cramps, commonly called charley horses, happen when motor nerves in your legs fire too rapidly and force a muscle into a sustained, painful contraction you can’t voluntarily release. The problem is rarely one single cause. Instead, a web of triggers including muscle fatigue, fluid shifts, aging, medications, and underlying health conditions can all push your nerves toward that tipping point. Understanding which factors apply to you is the key to making the cramps less frequent.

What Is Actually Happening Inside Your Leg

A charley horse feels like a muscle seizing on its own, and that intuition is close to the truth. Research into the neurophysiology of cramping shows that the contraction originates not in the muscle fibers themselves but in the motor nerves that control them. The nerves begin firing at abnormally high rates, sending a barrage of signals that lock the muscle into a spasm. Several mechanisms can set this off, including heightened excitability at the nerve endings inside the muscle, reduced inhibition from the spinal cord, and even electrical cross-talk between neighboring nerve fibers that causes the contraction to spread.1PubMed. Muscle cramp: main theories as to aetiology Think of it less like a muscle malfunctioning and more like a nerve misfiring, with the muscle doing exactly what it’s told to do by a nerve that has temporarily lost control of itself.

This distinction matters because it shapes how you think about prevention. Most people assume the answer is “drink more water” or “take magnesium,” and those ideas have their place. But the nerve-excitability model explains why cramps can strike even when you’re well hydrated, well nourished, and lying still in bed. It also explains why certain interventions work in ways that have nothing to do with hydration.

Dehydration and Electrolytes Are Part of the Story, Not All of It

The old advice to drink more fluids and replace electrolytes isn’t wrong, but it’s incomplete. One controlled exercise study found that about 69% of participants still experienced exercise-related muscle cramps even when they were both hydrated and supplemented with electrolytes.2PubMed Central. Influence of Hydration and Electrolyte Supplementation on Incidence and Time to Onset of Exercise-Associated Muscle Cramps That’s a striking number. If dehydration were the primary driver, keeping fluid and salt levels topped up should have prevented most cramps, and it didn’t.

That said, fluid balance does seem to influence how easily your muscles cramp under the right conditions. Experimental work has shown that drinking plain water after becoming dehydrated can actually make muscles more susceptible to cramping, while drinking an electrolyte solution maintains the threshold at which cramps are triggered. The mechanism appears tied to drops in blood sodium and chloride concentrations that occur when you rehydrate with plain water but not when you use an electrolyte drink.3PubMed Central. Water intake after dehydration makes muscles more susceptible to cramp but electrolytes reverse that effect So electrolytes don’t prevent cramps outright, but diluting your blood electrolytes by chugging plain water during or after heavy sweating can tilt the odds against you.

The practical takeaway: if you’re sweating a lot from exercise, heat, or physical labor, an electrolyte drink is a better choice than water alone. But don’t expect hydration to be the whole solution if your cramps come on at rest or during the night.

Muscle Fatigue and the Altered Neuromuscular Control Theory

Among exercise scientists, an increasingly supported theory holds that muscle fatigue is the main catalyst for exercise-related cramps. The idea, sometimes called the “altered neuromuscular control” hypothesis, goes roughly like this: when a muscle gets overworked, the normal feedback loop between the muscle and the spinal cord falls out of balance. The signals that promote contraction ramp up while the signals that inhibit contraction fade, and eventually the motor nerve fires uncontrollably.4British Journal of Sports Medicine. Cause of Exercise Associated Muscle Cramps (EAMC) — altered neuromuscular control, dehydration or electrolyte depletion?

This model neatly explains a few things the dehydration theory can’t. Cramps during exercise tend to hit the specific muscles doing the most work, not muscles throughout the body, which you’d expect if the problem were a systemic electrolyte shortage. It also explains why cramps are more common toward the end of a long run or a demanding workout than at the beginning, since the spinal reflex dysfunction worsens as the muscle fatigues. A review in Sports Medicine characterized the situation honestly: the causes of exercise-associated cramps remain uncertain, but some cases appear linked to salt and water disturbance while others involve sustained abnormal spinal reflex activity from fatigued muscles.5PubMed Central. Muscle Cramping During Exercise: Causes, Solutions, and Questions Remaining The truth is probably that both mechanisms operate, sometimes in the same person, sometimes in the same cramp.

It’s worth noting that strong experimental evidence for either the dehydration or the neuromuscular theory is still considered lacking.6PubMed Central. Exercise-associated muscle cramps: causes, treatment, and prevention Researchers have been arguing about this for decades, which might sound discouraging, but it actually means something useful for you: if one approach to prevention hasn’t worked, it’s reasonable to try the other, because the mechanisms are genuinely different.

Why Cramps Hit Hardest at Night

If your charley horses tend to wake you up at 3 a.m., you’re in good company. Nocturnal leg cramps are considered among the most common sleep-disrupting conditions. A systematic review identified seven core features that define them: intense pain, duration lasting from a few seconds up to about ten minutes, location most often in the calf or foot and only rarely the thigh, lingering soreness afterward, and the resulting sleep disruption and distress.

The reason cramps favor nighttime likely involves several converging factors. When you’re lying in bed, your feet tend to rest in a slightly pointed-toe position, which shortens the calf muscles. Shortened muscles are closer to that threshold where a nerve can fire inappropriately. Prolonged immobility also means there’s less of the natural movement and stretching that would ordinarily reset nerve excitability throughout the day. On top of that, fluid redistribution occurs when you lie flat: fluid that pooled in your legs during the day shifts back into your bloodstream, which may alter the electrolyte environment around nerve endings in the legs.

People often confuse nocturnal leg cramps with restless legs syndrome, but they’re distinct conditions. Restless legs syndrome creates an uncomfortable urge to move, usually relieved by movement, and isn’t a true muscle contraction. A nocturnal leg cramp is a sudden, involuntary, and visibly tightened muscle that produces sharp pain. If you can actually see or feel a hard knot in your calf during the episode, it’s almost certainly a cramp rather than restless legs.

Age, Sex, and Pregnancy

Older adults get leg cramps far more often. In one study of people aged 60 and older, nearly one third had experienced rest cramps in the prior two months, and the rate climbed to about half among those over 80.7Age and Ageing. A review of nocturnal leg cramps in older people Another study of elderly outpatients found that half had rest cramps, with a fifth reporting the problem for a decade or longer. Most research also finds that nocturnal cramps are more common in women, especially older women.

Several age-related changes conspire to make cramps more likely. Motor neurons naturally decline with age, particularly in the legs, and fewer motor neurons means the remaining ones have to work harder, which may make them more prone to misfiring. Tendons shorten over the years and during periods of immobility, increasing nerve terminal excitability. A case-control study found that people with nocturnal cramps scored lower on measures of lower leg muscle strength than people without cramps, suggesting that age-related muscle weakness is part of the picture.7Age and Ageing. A review of nocturnal leg cramps in older people The medications older adults commonly take, particularly diuretics, can compound the problem by depleting electrolytes.8Journal of the Korean Geriatrics Society. Muscle Cramps in Old Adults: Clinical Features and Pathophysiology

Pregnancy is another well-known trigger, especially in the second and third trimesters. The causes likely include increased weight on the legs, fluid shifts, and changing mineral balance. Interestingly, while a meta-analysis of pregnancy-related cramps found that magnesium supplementation reduced cramp frequency compared with placebo,9PubMed Central. The Role of Electrolytes in Muscle Pain Syndromes: A Systematic Review and Meta-Analysis With Implications for Temporomandibular Disorder a separate meta-analysis focused specifically on oral magnesium for pregnancy leg cramps found no meaningful benefit.10PubMed. Effect of oral magnesium supplementation for relieving leg cramps during pregnancy: A meta-analysis of randomized controlled trials The evidence genuinely contradicts itself here, which means pregnant women considering magnesium should talk it over with their provider rather than assuming it will help.

There’s also a hereditary angle. Rare cases of persistent distal cramps have been documented running through multiple generations of the same family, appearing earlier in life and with greater intensity in each successive generation.11PubMed Central. Hereditary persistent distal cramps Most people’s cramps aren’t caused by a genetic condition, but if several blood relatives share the same complaint, it’s worth mentioning to a doctor.

Medical Conditions That Can Drive Recurring Cramps

When cramps are frequent and don’t respond to the usual lifestyle adjustments, an underlying medical condition may be contributing. Several deserve mention because they’re common enough that you or someone you know may be affected.

Certain medications are notorious for provoking cramps as well. Diuretics (water pills) top the list by depleting potassium and magnesium. Statins, some blood pressure drugs, and asthma medications have also been associated with increased cramp frequency. If your cramps started or worsened after beginning a new medication, that connection is worth raising with your prescriber.

What Actually Stops a Cramp in the Moment

When a charley horse strikes at 2 a.m., you need relief now, not a lecture on motor neuron physiology. The most effective immediate response is to stretch the cramping muscle. For a calf cramp, that means pulling your toes toward your shin, either by hand or by standing and pressing your heel flat against the floor. Walking around can also help because the act of walking forces the opposing muscles to activate, which inhibits the cramping muscle through a spinal reflex.

One of the more surprising findings in cramp research involves pickle juice. A study found that drinking a small amount of pickle juice inhibited electrically induced muscle cramps in dehydrated volunteers, and the effect happened too quickly to be explained by rehydration or electrolyte restoration. The researchers concluded that something in the pickle juice, likely the acetic acid, triggered a reflex from the mouth and throat that traveled down to the spinal cord and calmed the overexcited motor neurons.16PubMed. Reflex inhibition of electrically induced muscle cramps in hypohydrated humans This neural-reflex idea has since been explored further with compounds that activate specific sensory receptors (called TRP channels) in the mouth. Spicy or pungent substances like capsaicin, mustard oil, and ginger seem to produce a similar anti-cramp effect by overwhelming the nervous system with a competing sensory signal.17PubMed. Effects of TRPV1 and TRPA1 activators on the cramp threshold frequency: a randomized, double-blind placebo-controlled trial

This is still early-stage science, and nobody is going to prescribe you a shot of pickle brine in a clinical setting. But if you’ve tried it and it seems to work, the mechanism is plausible, and the risk is basically zero beyond a salty aftertaste.

The Magnesium Question

Magnesium supplements may be the single most common thing people try for leg cramps, and the evidence for them is surprisingly weak. A Cochrane review summary examining multiple trials of magnesium supplementation for idiopathic cramps in non-pregnant adults found that it did not significantly reduce cramp frequency, cramp intensity, or cramp duration compared to placebo. The reviewers concluded that magnesium supplementation is unlikely to be effective for skeletal muscle cramps at any of the dosages or routes tested.18PubMed Central. What is the role of magnesium for skeletal muscle cramps? A Cochrane Review summary with commentary

A randomized trial specifically testing magnesium oxide for nocturnal leg cramps in older adults found that both the magnesium and placebo groups experienced a large reduction in cramp frequency, roughly 48% and 30% respectively, but the difference between the two groups was not statistically significant.19JAMA Internal Medicine. Effect of Magnesium Oxide Supplementation on Nocturnal Leg Cramps: A Randomized Clinical Trial The placebo effect in cramp studies is notoriously large: just believing you’re taking something helpful, combined with natural fluctuations in cramp frequency over time, often produces an impressive improvement that has nothing to do with the supplement itself.

The one exception, as noted earlier, is pregnancy-related cramps, where some data points toward a small benefit. But for the general population dealing with nocturnal or idiopathic cramps, spending money on magnesium supplements is probably not going to change much. That doesn’t mean magnesium is useless for other health purposes, and a genuine deficiency should be corrected regardless. But correcting a deficiency and treating cramps are different goals, and the evidence only supports the first.

Stretching Before Bed

If magnesium doesn’t hold up well under scrutiny, stretching fares considerably better, at least for nocturnal cramps. A randomized trial of adults aged 55 and older found that six weeks of nightly calf and hamstring stretching reduced the frequency of nocturnal leg cramps by about 1.2 cramps per night more than the control group, and also reduced pain severity.20PubMed. Stretching before sleep reduces the frequency and severity of nocturnal leg cramps in older adults: a randomised trial A pilot study in frail adults over 75 found similar results: six weeks of stretching reduced both frequency and pain intensity of nighttime cramps.21PubMed. Pilot testing a stretching regimen for prevention of night time nocturnal leg cramps

A Cochrane review of non-drug therapies confirmed that a combination of daily calf and hamstring stretching for six weeks may reduce the severity of nocturnal cramps in older adults, though the evidence certainty was rated as low.22PubMed Central. Non‐drug therapies for the secondary prevention of lower limb muscle cramps The same review noted that calf stretching alone for 12 weeks made little difference to cramp frequency, which suggests that stretching both the calf and hamstring muscles matters more than stretching just one muscle group. The stretches themselves are simple: a standing calf stretch against a wall and a seated hamstring stretch, held for 10 to 30 seconds and repeated a few times before bed.

The evidence is imperfect, but stretching is free, carries essentially no risk, and the trials that have been done consistently point in a positive direction. It’s the closest thing to a well-supported intervention for people whose cramps are recurrent but not caused by an identifiable medical condition.

When Recurring Cramps Deserve Medical Attention

Most charley horses, even frequent ones, are benign. But a few patterns should prompt a visit to your doctor. Cramps that are accompanied by visible muscle wasting, numbness, or persistent weakness may signal a nerve or neuromuscular disorder rather than a simple cramp tendency. Cramps that began alongside a new medication are worth reporting, since a dose adjustment or switch may eliminate the problem. And cramps that are severe, happening nightly despite stretching and lifestyle changes, and significantly disrupting your sleep deserve investigation for underlying causes like venous insufficiency, thyroid dysfunction, kidney disease, or liver disease.

Doctors previously prescribed quinine for severe cramps, and it does reduce cramp frequency. But regulatory agencies in several countries pulled quinine from over-the-counter cramp products years ago due to rare but serious side effects including heart rhythm problems and a dangerous blood disorder. It’s still sometimes prescribed off-label for truly intractable cases, but the risk-benefit calculation is different now than it was when quinine tonic water was the standard recommendation. If your cramps are bad enough that you’ve considered seeking out quinine, that’s exactly the kind of situation where a proper medical workup makes sense first, because finding and treating an underlying cause is always preferable to managing symptoms with a drug that has real risks.