What Causes a Charley Horse in Your Leg?

A charley horse is a sudden, involuntary contraction of a muscle in your leg that can last anywhere from a few seconds to several minutes. Between 50 and 60 percent of adults experience these cramps, and the likelihood increases as you get older. While they’re rarely dangerous, understanding what triggers them can help you avoid them.

What Happens Inside the Muscle

Leg cramps originate in your nervous system, not in the muscle itself. Your motor neurons, the nerve cells that tell muscles when to contract, become abnormally excitable and fire without your input. The result is an intense, sustained contraction you can’t voluntarily release.

Under normal conditions, your body has a built-in braking system. Sensors embedded in your tendons detect how much force a muscle is producing, and when that force gets too high, they send a signal that tells the motor neuron to ease off. During a cramp, this braking system fails. The signals telling the muscle to contract overwhelm the signals telling it to relax, and the muscle locks up. This imbalance is especially likely when a muscle is already in a shortened position, which is one reason calf cramps strike so often at night when your foot is pointed downward under the covers.

Common Triggers

Muscle Fatigue and Overuse

The most widely supported explanation for exercise-related cramps is that fatigue disrupts the normal feedback loop between your muscles and your nervous system. When a muscle is tired, the sensors that promote contraction become overactive while the sensors that inhibit contraction become underactive. This is why cramps tend to hit toward the end of a long run or a workout you weren’t conditioned for, not at the beginning.

Dehydration and Electrolyte Shifts

Losing fluids through sweat, illness, or not drinking enough water changes the concentration of minerals like sodium, potassium, magnesium, and calcium in your blood. These minerals are essential for normal nerve signaling and muscle contraction. When levels drop or shift, motor neurons become more excitable and more likely to fire on their own. Heavy sweating during exercise or hot weather is a classic setup for this kind of cramp.

Prolonged Sitting or Standing

Staying in one position for a long time reduces blood flow to leg muscles and can leave them in a shortened or compressed state. This is one reason office workers and people on long flights get cramps. The combination of reduced circulation and sustained muscle positioning primes the nervous system for an involuntary contraction.

Medications

Several types of medication increase cramp risk. Diuretics (water pills), commonly prescribed for blood pressure, flush fluid and electrolytes from your body. Cholesterol-lowering statins are well known for causing muscle pain, soreness, and weakness in roughly 5 percent of people who take them, with higher doses carrying greater risk. If you started a new medication around the time cramps became frequent, that connection is worth discussing with your doctor.

Pregnancy

About 40 percent of pregnant women experience leg cramps, most commonly in the second and third trimesters. The extra weight strains leg muscles, and shifts in calcium and magnesium levels during pregnancy may also play a role. Some research suggests that magnesium supplements can help, though the evidence is mixed.

Why Cramps Strike at Night

Nocturnal leg cramps are the most common type, and several factors converge while you sleep. Your foot naturally falls into a pointed position (called plantar flexion), which shortens the calf muscle and puts it in prime cramping territory. You’re also not moving, so blood flow to your legs is reduced. On top of that, you go hours without drinking water, which can tip your electrolyte balance just enough to make motor neurons more excitable. The prevalence is slightly higher in women, and people over 50 are especially prone.

When Cramps Signal Something Else

Most charley horses are harmless, but recurring cramps can occasionally point to an underlying condition. Spinal stenosis, a narrowing of the spinal canal in the lower back, can cause pain or cramping in one or both legs, particularly when standing or walking for extended periods. A distinguishing feature: the discomfort improves when you bend forward or sit down. Peripheral artery disease, where narrowed blood vessels reduce blood flow to the legs, can also cause cramping during activity. Nerve damage from diabetes, thyroid disorders, and kidney disease are other conditions that can make cramps more frequent.

If your cramps are severe, happen almost every night, don’t improve with stretching and hydration, or come with swelling, numbness, or muscle weakness, those patterns are worth medical attention.

How to Stop a Cramp in Progress

Stretching is the most effective immediate remedy, and there’s a clear physiological reason why. When you hold a stretch for more than about seven seconds, the tension sensors in your tendon activate and send an inhibitory signal to the motor neuron, essentially overriding the contraction. For a calf cramp, flex your foot upward by pulling your toes toward your shin, either with your hand or by standing and pressing your heel into the floor. Hold the stretch steadily rather than bouncing.

Massaging the cramped muscle and applying heat can also help by increasing blood flow. Walking around for a few minutes after the cramp releases helps reset normal muscle function and prevent a second spasm.

Reducing Your Risk

Staying hydrated is the simplest preventive step, especially if you exercise, work outdoors, or take diuretics. Aim to drink water consistently throughout the day rather than trying to catch up all at once. Eating foods rich in potassium (bananas, potatoes, avocados), magnesium (nuts, seeds, leafy greens), and calcium (dairy, fortified plant milks) helps maintain the mineral balance your muscles depend on.

Stretching your calves and hamstrings before bed can reduce nocturnal cramps. A simple wall stretch, where you lean forward with your hands on a wall and one leg extended behind you with the heel flat, held for 20 to 30 seconds on each side, is often enough. Keeping blankets loose at the foot of the bed prevents your feet from being pushed into a pointed position overnight.

If you exercise regularly, building up intensity gradually rather than making sudden jumps gives your neuromuscular system time to adapt. Cramps are far more common when muscles are asked to do work they haven’t been trained for.