Nighttime leg cramps—medically known as nocturnal leg cramps—are sudden, involuntary muscle contractions that strike while you’re resting or asleep. Most often, they affect the calves, but they can also occur in the thighs or feet. The pain can be sharp and intense, sometimes lasting only a few seconds, other times dragging on for several minutes and leaving muscles sore for hours afterward.

If you’ve ever been pulled out of deep sleep by a painful cramp, you already know how disruptive these episodes can be. Beyond the immediate discomfort, recurring leg cramps can interfere with sleep quality, daytime energy, and overall well-being.
So what causes nighttime leg cramps—and what can you realistically do to prevent them? Let’s take a deeper, evidence-based look.
What Are Nighttime Leg Cramps?
Nighttime leg cramps are muscle spasms, not to be confused with restless legs syndrome (RLS). Unlike RLS—which causes an urge to move the legs—leg cramps involve actual muscle tightening and pain. During a cramp, the muscle becomes hard and visibly knotted, making it difficult or impossible to relax.
They can affect people of all ages but are especially common in:
- Older adults
- Pregnant women
- Athletes
- People with certain medical conditions

