Skip to main content

Nighttime cramps

Nighttime cramps are sudden, painful muscle contractions that usually happen in the calf, foot, or thigh during sleep. They can wake a person abruptly, make it hard to return to sleep, and leave the muscle sore for hours afterward.

Nighttime cramps are also called sleep-related leg cramps or nocturnal leg cramps. They are common in adults, especially later in life, but frequent or severe cramps should not be dismissed as “just aging.” They may be linked with medications, circulation or nerve problems, pregnancy, metabolic conditions, heavy exercise, dehydration, or another sleep or medical concern.

A whole-24-hours view can help identify patterns. What happens during the day — activity, hydration, medications, alcohol use, long sitting, health conditions, and sleep timing — may influence what happens at night.

Overview

  • Nighttime cramps are sudden, painful muscle contractions that often affect the calf, foot, or thigh during the sleep period.
  • A cramp may last seconds to several minutes and may leave the muscle tender
  • Nighttime cramps are different from restless legs syndrome
  • Many adults have occasional nighttime cramps, but frequent cramps can reduce sleep quality and affect daytime function
  • Evaluation is important when cramps are severe, worsening, linked with other symptoms, or possibly related to medications or medical conditions
  • Management often focuses on stretching, gentle movement, reviewing contributors, and treating any underlying condition

About nighttime cramps

Nighttime cramps are involuntary muscle contractions that occur during rest, near bedtime, or during sleep. The affected muscle suddenly tightens and becomes painful. The calf is the most common location, but cramps can also affect the foot or thigh.

A nighttime cramp may begin suddenly, or it may start with a warning sensation before the muscle locks. The cramp usually eases when the muscle is stretched, massaged, or moved. Some people feel soreness for hours after the cramp ends.

Nighttime cramps are classified as a sleep-related movement disorder when they repeatedly disturb sleep. They are common in adults and tend to become more frequent with age. In one primary care study of adults over age 60, about one-third reported cramps at least once every two months.⁠ ⁠Studies also suggest that nighttime cramps can meaningfully affect sleep quality and quality of life, particularly in older adults.⁠

Signs and symptoms

Nighttime cramps happen during the sleep period, but the pattern often reaches across the whole day. Daytime hydration, physical activity, prolonged sitting, footwear, medications, alcohol use, medical conditions, and evening routines may all shape nighttime symptoms.

Sleep disruption can also create a loop. A person may wake in pain, become alert, worry about another cramp, and then have difficulty returning to sleep. Over time, repeated nights of interrupted sleep can affect mood, concentration, energy, and daily function.

Taking a 24-hour view can be helpful with nighttime cramps. Identifying daytime activities and behaviors that contribute to symptoms can be used to work out patterns that connect to nighttime experiences, and allow people to make changes that optimize wellbeing.

Nighttime symptoms

Nighttime cramps may include:

  • Sudden, sharp pain in the calf, foot, or thigh
  • Visible or felt tightening of the muscle
  • Difficulty moving the affected area during the cramp
  • Waking from sleep because of pain
  • Relief after stretching, standing, walking, or massaging the muscle
  • Lingering tenderness or soreness after the cramp ends

Daytime effects

Nighttime cramps can affect the next day by causing:

  • Fatigue from disrupted sleep
  • Sleepiness or reduced alertness
  • Worry about going to bed
  • Reduced physical activity because of soreness or fear of another cramp
  • Strain on a bed partner’s sleep if episodes are frequent or dramatic

How nighttime cramps differ from restless legs syndrome

Nighttime cramps are sometimes confused with restless legs syndrome. Restless legs syndrome (RLS) usually causes an urge to move the legs, often with uncomfortable sensations, and movement tends to bring quick relief. Nighttime cramps involve a painful muscle contraction and often require stretching or time before the pain settles.⁠

Screening and diagnosis

A clinician can often evaluate nighttime cramps through a medical history and physical exam. Testing is not always needed when symptoms are typical, occasional, and not linked with concerning features.⁠

A clinician may ask:

  • Where does the cramp happen?
  • How often does it occur and how long does it last?
  • What helps it stop?
  • Is there soreness, weakness, numbness, swelling, or color change?
  • Are symptoms linked with exercise, long sitting, pregnancy, dehydration, or alcohol use?
  • What medications or supplements are being used?
  • Are there symptoms of restless legs syndrome, neuropathy, sleep apnea, or another sleep disorder?
  • Are there medical conditions such as diabetes, kidney disease, thyroid disease, vascular disease, or nerve or muscle disorders?

When to talk with a healthcare professional

A person does not need to know the name or exact nature of a condition before asking for help. If a person experiences any of the symptoms above, it is appropriate to discuss them with a healthcare professional. 

Red Flag: Seek urgent medical care if symptoms, pain, or sleep loss are affecting a person’s ability to drive or work safely, or is causing severe distress or thoughts of self-harm.

What to bring to a doctor’s visit

A primary care physician is a good place to start for a sleep disorder evaluation. They can conduct preliminary screenings and recommend next steps for diagnosis. It can be helpful to bring information to an initial visit: try using WSCN’s How to talk to your primary care clinician about sleep problems checklist.

Causes, risk factors and health implications

Causes and risk factors

The cause of nighttime cramps is often unclear. In many cases, nighttime cramps are “idiopathic,” meaning no single cause is found. Possible contributors include:

  • Age: Cramps become more common in later adulthood.
  • Medications: Some medications may contribute to cramps in some people. 
  • Medical conditions: Diabetes, vascular disease, nerve or muscle conditions, metabolic disorders, endocrine disorders, and reduced mobility may increase risk.⁠
  • Activity patterns: Vigorous exercise, unfamiliar activity, prolonged standing, or prolonged sitting may contribute.
  • Hydration and electrolytes: Dehydration or fluid and electrolyte disturbance may play a role for some people.
  • Pregnancy: Leg cramps are common during pregnancy and often improve after delivery.⁠
  • Fascia:

Long-term health implications

The cramp itself is usually short-lived. Longer-term risk often comes from repeated sleep disruption, reduced activity, or an untreated contributing condition.

  • Sleep health: Repeated awakenings may contribute to insomnia symptoms and reduced sleep confidence. 
  • Mental health: Ongoing pain and poor sleep may increase stress, irritability, anxiety, or low mood.
  • Daytime safety: Poor sleep may affect concentration, memory, reaction time, and driving safety.
  • Physical function: Fear of cramps or lingering soreness may reduce movement, conditioning, or confidence with activity.
  • Heart and metabolic health: If cramps are linked with untreated vascular disease, diabetes, kidney disease, chronic sleep disruption, or low activity, those underlying issues may have broader health implications.
  • Missed diagnosis: Persistent cramps may be an opportunity to identify medication effects, vascular disease, neuropathy, metabolic problems, or another sleep disorder.

Treatment and management

Treatment depends on how often cramps happen, how severe they are, and whether another condition is contributing.

During a cramp

Strategies that may help relieve symptoms include:

  • Gently stretching the affected muscle
  • Standing or walking carefully
  • Gently massaging the tight muscle
  • Applying heat after the cramp

Prevention and daily management

Common approaches include:

  • Calf and hamstring stretching before bed
  • Regular, fitness-appropriate physical activity with a focus on strength and mobility
  • Avoiding sudden overexertion when possible
  • Sufficient daytime hydration
  • Limiting alcohol close to bedtime if it appears to worsen symptoms
  • Keeping bedding loose around the feet if tight sheets seem to trigger foot position problems
  • Tracking cramps alongside medications, activity, and sleep timing

A randomized trial in adults over age 55 found that nightly calf and hamstring stretching before sleep reduced cramp frequency and severity over six weeks.⁠ However, findings across stretching studies have not been fully consistent, and exercise plans should be adapted to each person’s mobility and safety, with input from a physical therapist.

No treatment has been proven to be both consistently effective and risk-free for all adults with nighttime cramps. Magnesium is commonly tried, but systematic reviews have not shown clear benefit for typical older adults with idiopathic nighttime cramps.⁠

⁠Quinine has evidence of some effectiveness, but it can cause serious adverse effects and is generally not recommended for routine cramp treatment.⁠

Medication decisions should be individualized and clinician-guided, especially for adults with kidney disease, heart rhythm concerns, pregnancy, multiple medications, or neurological symptoms.

Research and What We Are Still Learning

Researchers are still working to clarify why nighttime cramps happen, why they become more common with age, and which treatments help specific groups. Diagnostic criteria have varied across studies, which makes research harder to compare. A systematic review proposed criteria to help distinguish nocturnal leg cramps from restless legs syndrome and periodic limb movement disorder.⁠

References

Coppin, R. J., Wicke, D. M., & Little, P. S. (2005). Managing nocturnal leg cramps: Calf-stretching exercises and cessation of quinine treatment: A factorial randomised controlled trial. British Journal of General Practice, 55(512), 186–191. https://pubmed.ncbi.nlm.nih.gov/15808033/

Garrison, S. R., Dormuth, C. R., Morrow, R. L., et al. (2012). Nocturnal leg cramps and prescription use that precedes them: A sequence symmetry analysis. Archives of Internal Medicine, 172(2), 120–126. https://doi.org/10.1001/archinternmed.2011.1029

Hallegraeff, J. M., de Greef, M. H. G., Krijnen, W. P., & van der Schans, C. P. (2017). Criteria in diagnosing nocturnal leg cramps: A systematic review. BMC Family Practice, 18, 29. https://doi.org/10.1186/s12875-017-0600-x

Hallegraeff, J. M., van der Schans, C. P., de Ruiter, R., & de Greef, M. H. G. (2012). Stretching before sleep reduces the frequency and severity of nocturnal leg cramps in older adults: A randomised trial. Journal of Physiotherapy, 58(1), 17–22. https://doi.org/10.1016/S1836-9553(12)70068-1

Maisonneuve, H., Chambe, J., Delacour, C., et al. (2016). Prevalence of cramps in patients over the age of 60 in primary care: A cross sectional study. BMC Family Practice, 17, 111. https://doi.org/10.1186/s12875-016-0509-9

Rabbitt, L., Mulkerrin, E. C., & O’Keeffe, S. T. (2016). A review of nocturnal leg cramps in older people. Age and Ageing, 45(6), 776–782. https://doi.org/10.1093/ageing/afw139

Sebo, P., Cerutti, B., & Haller, D. M. (2014). Effect of magnesium therapy on nocturnal leg cramps: A systematic review of randomized controlled trials with meta-analysis using simulations. Family Practice, 31(1), 7–19. https://doi.org/10.1093/fampra/cmt065

American Academy of Sleep Medicine. (2021). Sleep leg cramps. Sleep Education. https://sleepeducation.org/sleep-disorders/sleep-leg-cramps


Medical disclaimer
This article is for educational purposes only and is not intended to replace professional medical advice, diagnosis, or treatment. Speak with a qualified healthcare professional about questions or concerns related to your sleep. Read full medical disclaimer