You’re deep asleep when a bolt of pain suddenly rips through your calf. Your muscle turns to stone, you can’t move your foot, and all you can do is gasp and wait for it to ease.
That’s a night leg cramp – or “charley horse” – and for many people it feels like it comes out of nowhere.
According to the Cleveland Clinic, leg cramps are painful, involuntary muscle contractions that can last from a few seconds to several minutes and can seriously disturb your sleep and daily life.
They most often hit the calf, but can also affect the feet and thighs. Afterwards, the area may stay sore for hours, and some people even start to dread going to bed because they’re afraid it will happen again.
So what triggers these nighttime spasms – and how can you reduce them?

1. Dehydration
One of the most common culprits is simply not drinking enough fluids.
When you’re dehydrated, the balance of electrolytes in your body (like sodium, potassium, and magnesium) gets thrown off. Those electrolytes are crucial for normal muscle contraction and relaxation, so an imbalance makes spasms more likely.
The Mayo Clinic lists dehydration as a key risk factor for muscle cramps.
What to do:
Sip water regularly throughout the day, not just in big bursts. Pay extra attention if you’ve been sweating from heat or exercise.
2. Mineral deficiencies
Low levels of magnesium, potassium, or calcium can disrupt the signals that travel along your nerves and tell muscles when to tighten or release.
Even a small deficiency can be enough to cause misfiring and cramping, especially in the legs. MedlinePlus notes that these mineral imbalances are linked to muscle cramps.
What to do:
Try to include mineral-rich foods in your meals:
Bananas, potatoes, and beans for potassium
Leafy greens, nuts, and seeds for magnesium
Dairy products or fortified alternatives for calcium
If you suspect a deficiency, talk to a doctor before starting supplements.
3. Overworked muscles
Sometimes cramps are your muscles’ way of saying, “We’re exhausted.”
Heavy workouts, long shifts on your feet, or intense physical labor can leave muscles fatigued. The American Academy of Orthopaedic Surgeons points out that overuse is a frequent cause of cramping, especially in active people and athletes.
What to do:
Warm up before exercise and cool down afterwards
Build up training gradually instead of making sudden jumps in intensity
Give yourself rest days so your muscles can recover
4. Too much sitting or standing
On the flip side, hardly moving at all can also lead to cramps.
Spending hours at a desk, behind a steering wheel, or standing in one spot can make muscles stiff and reduce blood flow. Over time, this lack of movement can set you up for nighttime cramps.
What to do:
Stand, walk, or stretch for a few minutes every hour
Gently stretch your calves and hamstrings before bed if you’ve been inactive most of the day
5. Poor posture
Slouching, crossing your legs for long periods, or standing with your weight unevenly distributed can overload certain muscles and nerves in your lower body. That ongoing strain may show up later as cramping when you finally lie down to rest.
What to do:
Check in with your posture during the day – shoulders relaxed, weight balanced, feet flat
Use ergonomic chairs, desks, and supportive shoes when possible
6. Nerve compression
Sometimes the problem isn’t in the muscle itself, but in the nerves that control it.
Conditions such as sciatica or herniated discs can compress nerves along the spine that run into the legs. Cedars-Sinai notes that nerve compression can cause pain, tingling, weakness, or muscle cramps in the lower limbs.
What to do:
If you have leg cramps plus back pain, numbness, or tingling, see a healthcare provider. They may recommend physical therapy, imaging tests, or other treatments.
7. Pregnancy
Leg cramps are very common during pregnancy, especially in the second and third trimesters. Extra body weight, changing hormones, and pressure on blood vessels all play a role.
What to do:
Stay well hydrated
Stretch your legs gently before going to sleep
Wear comfortable, supportive footwear
Talk to your midwife or doctor if cramps are severe or frequent
8. Medication side effects
Some prescription drugs list muscle cramps among their side effects. The Cleveland Clinic mentions:
Certain diuretics (water pills)
Statins (cholesterol medications)
Some psychiatric or sleep medications
What to do:
If cramps started soon after you began a new medication, bring it up with your doctor. Never stop a prescribed drug on your own, but ask whether an alternative is possible.
9. Alcohol and lifestyle factors
Heavy or frequent alcohol use can dehydrate you and deplete minerals such as magnesium, which increases your risk of cramping.
Some research has found a strong link between overall alcohol consumption and nocturnal leg cramps.
What to do:
Cut down on alcohol, especially in the evening
Eat balanced meals and drink plenty of water to support muscle function
10. Underlying health conditions
In some cases, repeated night cramps are a sign of a deeper issue. Conditions like diabetes, kidney disease, thyroid disorders, or peripheral artery disease can affect circulation, nerve health, or electrolyte balance and trigger muscle spasms.
What to do:
If your cramps are frequent, severe, or getting worse, it’s important to get checked by a healthcare professional.
Fast relief when a cramp hits
When a cramp strikes, it usually feels like there’s no time to think — you just want it to stop.
Healthline and other medical sources suggest these steps:
Gently stretch the cramped muscle – for a calf cramp, straighten your leg and pull your toes toward your shin
Massage the tense area with your hands or a massage roller
Apply heat (warm towel, heating pad, or bath) to relax tight muscles
Stay hydrated throughout the day to reduce future episodes
Some people find brief relief from small amounts of salty fluids, such as pickle juice, which may help restore electrolytes more quickly
If a cramp lasts more than several minutes, is extremely painful, or comes with swelling, weakness, or other unusual symptoms, seek medical advice promptly.
Takeaway
Night leg cramps are common, but they don’t have to be an unavoidable part of getting older or going to bed.
By staying hydrated, eating a mineral-rich diet, moving regularly, and paying attention to posture and medications, many people can significantly cut down on how often cramps strike – and how intensely they hurt.
And if your cramps are frequent or severe, don’t just suffer in silence. Talk with a healthcare professional to rule out underlying conditions and get a tailored plan to help you sleep pain-free again.







