How to Avoid Charley Horses While Sleeping

Charley horses are preventable in most cases with a combination of regular stretching, proper hydration, and attention to a few lifestyle factors you might not have considered. These involuntary muscle contractions, most common in the calves, typically strike during the night or after exercise and are driven by muscle fatigue, nerve irritability, or both. Here’s what actually works to keep them from happening.

Stretch Your Calves Before Bed

The single most effective habit for preventing nighttime charley horses is a simple calf stretch done right before sleep. Stand about three feet from a wall, lean forward with your arms outstretched and palms flat against it, and keep both feet planted on the floor. Hold for a count of five, then repeat for at least five minutes. Cleveland Clinic recommends doing this three times a day if cramps are frequent, but a nightly session before bed is the minimum that makes a meaningful difference.

The logic is straightforward: your calf muscles shorten slightly while you sleep, especially if your feet naturally point downward under the covers. That shortened position makes the muscle more susceptible to spontaneous contraction. Stretching before bed lengthens the muscle fibers and reduces the nerve excitability that triggers a cramp. If you exercise during the day, stretch your legs both before and after your workout as well.

Stay Hydrated, Especially Later in the Day

Dehydration is one of the most common and most fixable triggers for charley horses. When your body is low on fluids, the electrolyte balance in your muscles shifts, making involuntary contractions more likely. This matters most in warm weather, after exercise, and if you take medications that increase urine output (diuretics for blood pressure are a frequent culprit).

You don’t need to force excessive water intake. Just pay attention to your urine color throughout the day: pale yellow means you’re well hydrated. If you tend to cramp at night, make sure you’re drinking water in the afternoon and evening rather than front-loading all your fluids in the morning. Sports drinks or electrolyte supplements can help if you’re sweating heavily, but plain water handles the job for most people.

Check Your Shoes

What you wear on your feet during the day directly affects whether your legs cramp at night. Shoes that are too tight restrict circulation and force your foot into unnatural positions, building up fatigue in your calves and foot muscles over hours. Switching from flats to heels (or vice versa) can trigger cramps because the change alters how your calf muscles engage throughout the day.

Look for shoes with arch support and enough room for your toes to move freely. If you have flat feet, this matters even more, because minimal arch support causes chronic strain on your foot and lower leg muscles. Over-the-counter sole inserts can improve blood flow and reduce the fatigue that leads to nighttime cramping.

The Truth About Magnesium

Magnesium supplements are probably the most popular remedy people try for charley horses, but the evidence is surprisingly weak. A review published by the American Academy of Family Physicians found that magnesium taken for less than 60 days showed no meaningful reduction in cramp frequency compared to placebo. Across five studies involving over 300 people, the difference amounted to less than one cramp per week.

There is limited evidence that magnesium oxide taken daily for longer than 60 days may start to help. One large trial of 184 patients found no significant improvement at 30 days, but cramp frequency and duration did begin to decrease after two full months of consistent use. So if you want to try magnesium, commit to at least two months before judging whether it’s working. Short courses aren’t worth the effort.

For pregnant women, the picture is similarly murky. A Cochrane review of eight trials found that magnesium supplements may reduce cramp frequency during pregnancy, but results were inconsistent. Calcium, vitamin C, and vitamin D showed no reliable benefit either. Despite how commonly these supplements are recommended, the science hasn’t confirmed that any single one reliably prevents pregnancy-related leg cramps.

Vitamin B Complex Shows Some Promise

One nutrient that does have modest evidence behind it is vitamin B complex. A study published in the journal Neurology found that a B complex supplement (including 30 mg of vitamin B6 per day) led to cramp remission in 86% of patients, even those who weren’t known to be deficient in B vitamins. The study was small, involving only 28 people, and compliance details were limited. But the American Academy of Neurology considers B complex “possibly effective” for muscle cramps, with no serious side effects reported in trials.

This doesn’t mean B vitamins are a guaranteed fix, but if you’re looking for a supplement to try alongside stretching and hydration, B complex has a better track record than most alternatives.

Medications That Cause Charley Horses

If your cramps started or worsened around the time you began a new medication, the drug itself could be the trigger. Some of the most common offenders include:

  • Diuretics (water pills for blood pressure), which deplete electrolytes
  • Statins for cholesterol, particularly atorvastatin, simvastatin, and fluvastatin, which are more likely to cause muscle symptoms than other statins in the same class
  • Birth control pills
  • Blood pressure medications beyond diuretics

Statins deserve special mention because their muscle side effects are so common. If you take a statin and experience frequent cramps or muscle aches, the issue can sometimes be resolved by switching to a different type. Rosuvastatin and pravastatin are less likely to cause muscle problems because they’re processed differently by the body. Certain other medications, including some antibiotics, antifungals, and heart rhythm drugs, can also interfere with how your body clears statins, raising their levels and making muscle symptoms worse.

Keep Your Feet in a Neutral Position at Night

Sleeping with your toes pointed downward shortens your calf muscles for hours, which is a recipe for cramping. If you sleep on your back, try keeping your blankets loose at the foot of the bed so the weight of the covers doesn’t push your feet into a pointed position. A pillow placed under your calves can also help keep your feet in a more neutral angle. Side sleepers can let their feet hang slightly over the edge of the mattress to avoid that same toe-pointing posture.

Underlying Conditions Worth Knowing About

Most charley horses are harmless, caused by nothing more than tired muscles, mild dehydration, or awkward sleeping positions. But frequent, severe, or worsening cramps can sometimes signal an underlying health issue. Conditions linked to recurrent leg cramps include diabetes and diabetic nerve damage, kidney disease, thyroid disorders (both overactive and underactive), peripheral artery disease, anemia, and Parkinson’s disease. Chronic alcohol use and liver cirrhosis also increase cramp frequency.

If your cramps don’t improve with stretching and hydration, or if they’re accompanied by persistent swelling, skin color changes, or warmth in one leg, that pattern looks different from a typical charley horse. Deep vein thrombosis, a blood clot in the leg, can cause cramping or soreness that starts in the calf but also produces swelling and skin discoloration that a simple muscle cramp does not. A clot that breaks loose can travel to the lungs, causing sudden shortness of breath, chest pain, or a rapid pulse.

A Simple Nightly Routine

Prevention doesn’t require a complicated regimen. The combination that covers the most common triggers looks like this: stretch your calves for five minutes before bed, drink water consistently throughout the day, wear supportive shoes, and keep your blankets loose so your feet aren’t pushed into a pointed position overnight. If you’re on a medication known to cause cramps, talk to your prescriber about alternatives. If you want to add a supplement, give B complex a try or commit to magnesium for at least 60 days before expecting results.