Causes of Leg Cramps at Night

man sitting on edge of bed at night with woman touching his back

PhotoAlto / Frederic Cirou / Getty Images

From the quiet of rest, an intense leg cramp leaves you grabbing at your calf and shouting, “Ouch!” What causes leg cramps at night? Sometimes called a Charley horse, learn about these painful muscle contractions and the most common associated conditions and likely causes.

What Is a Leg Cramp?

A leg cramp is defined as an intensely painful sensation in the leg or foot that is associated with a sudden, involuntary muscle contraction. This contraction makes the affected muscle feel hard or tight. When occurring in the foot, it may cause the toes to curl or extend involuntarily.

This cramping may start abruptly, without any clear precipitating trigger or be preceded by a less painful warning sensation, and may remit spontaneously. Most leg cramps last for several seconds until the intensity fades. At their worst, though more rarely, leg cramps can last for several minutes.

Leg cramps may affect the calf or small muscles within the foot. Less often these cramps may even affect the hamstring muscles at the back of the thigh.

Cramps may occur during wakefulness or during sleep and provoke awakenings. The tenderness may persist for several hours, contributing to insomnia when occurring at night.

Muscle testing during a leg cramp shows spontaneous firing of anterior horn cells, which coordinate muscle activity, followed by discharges within groups of muscle cells at a rate up to 300 times per second (considerably more than with voluntary muscle contractions). The resulting pain may occur from local metabolite disturbances or from local ischemia. Leg cramps out of sleep do not seem to be preceded by any specific identified sleep changes.


Leg cramps are extremely common: nearly every adult 50 years and older has experienced one at least once. In fact, the prevalence increases with aging. Only 7% of children or adolescents have had leg cramps, and it is virtually unknown among younger children. By contrast, it occurs at least occasionally in 1 out of 3 adults at age 60 years (with 6% having it nightly) and in 1 in 2 adults older than 80 years.

Pregnant women also seem to be a higher risk of experiencing leg cramps. Some 40% of pregnant women have leg cramps and delivery often resolves the recurrence of the condition.


Leg cramps may occur less than once per year, but when frequent, may happen with multiple episodes every night. This may quickly lead you to seek the cause.

First, it is important to differentiate leg cramps from other similar conditions. Restless leg syndrome may lead to discomfort in the legs with an urge to move when lying down at night to rest. These symptoms are relieved by movement and—importantly—are not associated with muscle contraction or tightening. Periodic limb movements of sleep (PLMS) are repetitive flexing movements, usually at the ankle or knee, that occur during sleep and are not associated with pain. Dystonias are characterized by the simultaneous contraction of conflicting muscle groups, such as the biceps and triceps in the arm, acting spontaneously at the same time.

It is likely that leg cramps occur for many different reasons: the underlying cause remains unknown. Many normal individuals have leg cramps. However, some of the predisposing factors seem to include:

  • Diabetes
  • Amyotrophic lateral sclerosis (ALS or Lou Gehrig’s disease)
  • Cramp fasciculation syndrome
  • Peripheral vascular disease
  • Low potassium (hypokalemia)
  • Low calcium (hypocalcemia)
  • Low magnesium (hypomagnesemia)
  • Prior vigorous exercise
  • Prolonged standing at work
  • Dehydration
  • Other fluid/electrolyte disturbances
  • Restricted movement or mobility
  • Endocrine disorders
  • Neuromuscular disorders
  • Liver cirrhosis
  • Hemodialysis

In addition, there are certain medications that may contribute to the risk of developing leg cramps at night. These include oral contraceptives, intravenous iron sucrose, teriparatide, raloxifene, diuretics, long-acting beta agonists, and statins. If you are concerned about the contribution of prescription medications, speak with your pharmacist or prescribing doctor.

Leg cramps can be very painful and if they occur persistently, consider getting evaluated. It is possible that a careful history and a few blood tests may help to identify potential contributions and help you to sleep better at night without painful interruptions. Treatments, including supplements or even a bar of soap, may provide relief.

Was this page helpful?

Article Sources

  • Allen RE, Kirby KA. “Nocturnal leg cramps.” Am Fam Physician. 2012; 86:350-5.
  • American Academy of Sleep Medicine. “International classification of sleep disorders,” 3rd ed. Darien, IL: American Academy of Sleep Medicine, 2014, pp. 299-303.
  • Butler J, et al. “Nocturnal leg cramps in older people.” Postgrad Med J. 2002; 78:596-8.
  • Garrison SR, et al. “Nocturnal leg cramps and prescription use that precedes them: a sequence symmetry analysis.” Arch Intern Med. 2012; 172:120-6.
  • Hawke F, et al. “Impact of nocturnal calf cramping on quality of sleep and health-related quality of life.” Qual Life Res. 2013; 22:1281-6.