Waking up in the middle of the night with a sharp, stabbing pain in your calf or foot is a miserable experience. These painful muscle spasms—known as nocturnal leg cramps—can last anywhere from a few seconds to several minutes, and the soreness often lingers long after the cramp has passed.
If you’ve ever leapt out of bed clutching your leg in the dark, you know just how disruptive they can be. But what actually causes these nighttime cramps? And more importantly, what can you do to prevent them from happening again?
This guide explores the common causes, prevention strategies, and treatment options so you can enjoy uninterrupted, restful sleep.

What Exactly Are Nighttime Leg Cramps?
Nighttime leg cramps are involuntary contractions of one or more muscles in the legs, most commonly the calves, thighs, or feet. They’re different from restless leg syndrome (RLS) or muscle twitches—conditions that usually cause tingling or the urge to move. Leg cramps, in contrast, are painful spasms that tighten the muscle suddenly and often without warning.
They tend to become more common with age, but anyone can experience them—from athletes and workers on their feet all day to those who live more sedentary lifestyles.
