How to Stop Leg Cramps

Leg cramps are painful, involuntary muscle contractions that can last seconds or minutes. These cramps, while generally benign, can significantly affect exercise routine, and impair quality of life by disrupting sleep patterns and causing anxiety about their recurrence (Garrison et al., 2012). Exercise-associated muscle cramps represent a distinct category, occurring during or immediately following physical activity in otherwise healthy individuals (Miller et al., 2010).

Some medical conditions and drugs can cause them, and there are some risk factors you will want to avoid. When a leg cramp happens, try flexing the muscle, applying heat or ice and massaging the area. Leg cramps are sudden, involuntary, intense muscle spasms, usually in your calf, foot, or thigh. Sometimes, the cramp may cause your leg muscles to contract and tighten uncontrollably.

Although painful to live with, cramps in your legs are generally harmless. Muscle cramps in your legs can last from several seconds to several minutes. The older you are, the more likely you are to have leg cramps. This is because your tendons naturally shorten as you age. Women are also more likely to get them.

Up to 60% of adults get leg cramps at night, as do up to 40% of children and teenagers.

Nighttime leg cramps are characterized by involuntary, painful contractions of the lower limb muscles that typically occur during periods of rest, most commonly at night, causing significant sleep disturbance and discomfort (Sebo et al., 2013). Nighttime leg cramps happen when you are not very active or when you are asleep. Leg cramps may wake you up, make it harder for you to fall back asleep, and leave you feeling sore all night.

The frequency of leg cramps depends on the person. Nighttime leg cramps are musculoskeletal disorders involving sudden, episodic, and persistently painful involuntary contractions primarily affecting the calf, hamstring, or foot muscles (Hallegraeff et al., 2017). Nighttime leg cramps can happen to anyone at any age, but they happen most often to older adults.

Of people over age 60, 33% will have a leg cramp at night at least once every two months. Nearly every adult aged 50 and older will have them at least one time. Approximately 40% of people experience leg cramps during pregnancy. That is because the extra weight of pregnancy strains your muscles.

About 3 out of 4 reported cases of leg cramps happen at night.

Given the high prevalence of nighttime leg cramps, affecting 50% to 60% of adults, it is crucial for healthcare providers to educate patients on the limited efficacy of many common remedies and to manage expectations regarding treatment outcomes (Tan et al., 2024). Nighttime leg cramps, frequently observed in older adults and pregnant individuals, manifest during prolonged inactivity, often leading to sleep disruption (Grandner & Winkelman, 2017). Unfortunately, leg discomforts happen very suddenly.

There are no warning signs. But there are risk factors, like pregnancy and the use of medications that have leg cramps as a side effect. If you know you have certain risk factors, you can be on the alert for leg discomforts, so you will not be as startled when they happen. A leg discomfort feels like a clenched, contracted muscle tightened into a knot. It can be severely uncomfortable, painful, or even unbearable.

Your muscles in the area might hurt for hours after the cramp goes away. Some leg discomforts happen for no known reason. The precise physiological mechanisms underlying nighttime leg discomforts remain largely elusive, though theories often involve neuronal hyperexcitability, fluid and electrolyte imbalances, or vascular insufficiency (Delacour et al., 2018). Possible causes of these leg discomforts include involuntary nerve discharges, part of your leg muscle is not getting enough blood, stress, and too much high-intensity exercise.

Possible causes for leg cramps at night include sitting for long periods of time, overusing your muscles, standing or working on concrete floors, having poor posture during the day, kidney failure, diabetic nerve damage, mineral deficits, and issues with blood flow.

Medications have side effects. A prescription you are taking could be causing your leg cramps. In that case, work closely with your healthcare provider to determine the pros and cons of the medication versus its side effects. Your healthcare provider may be able to put you on a different medication that does not have leg discomforts as a side effect. Certain pharmacological agents, including thiazide and potassium-sparing diuretics, long-acting beta-2 agonists, statins, and nifedipine, have been identified as potential contributors to the onset or exacerbation of nighttime muscle discomforts (Comair et al., 2024).

Cancer treatments like chemotherapy can cause nerve damage, which may also cause leg cramps. Sometimes, leg discomforts happen for no reason, but other times, they could be a sign or symptom of a health condition. While often idiopathic, these contractions can also be symptomatic of underlying conditions such as electrolyte imbalances, metabolic disorders, or peripheral neuropathies (Li et al., 2023).

Given the diverse potential etiologies, a comprehensive diagnostic approach is crucial for differentiating idiopathic nighttime leg cramps from those secondary to underlying medical conditions or medication side effects (Miller & Layzer, 2005). Your healthcare provider will need to know your medical history, medications, and a description of what you are experiencing.

There is no specific test to diagnose leg cramps.

Laboratory tests should be complemented by a physical examination to assess for musculoskeletal abnormalities, neurological deficits, and vascular compromise, as well as to differentiate true cramps from other conditions like restless legs syndrome or claudication (Roy, 2020). But your healthcare provider will likely check your vital signs and do routine tests. A thorough patient history should include detailed questions regarding the discomfort’s characteristics, frequency, duration, associated symptoms, and potential triggers (Maisonneuve et al., 2016).

These can show if you have a medical condition you did not know about. You want to get rid of a leg cramp the moment it strikes. You might be finishing up an exercise routine, or a discomfort might wake you up in the middle of the night. In moments like that, unfortunately, there are not any magical injections that can instantly relieve your pain. However, there are steps to take to possibly get rid of a leg discomfort.

A combination of daily calf and hamstring stretching for six weeks may alleviate the severity of night-time lower limb muscle cramps in individuals aged 55 and older, though its effect on discomfort frequency remains uncertain (Hawke et al., 2021). Stretch by straightening your leg and then flex it, pulling your toes toward your shin to stretch the muscles. Stretch the affected muscle and gently rub.

For a thigh cramp, try pulling the foot on that leg up toward your buttock.

Hold on to a chair to steady yourself. Massage the muscles by using your hands or a roller. Stand up and press your feet against the floor. Walk around and wiggle your leg. Implementing a consistent regimen of static stretching, particularly targeting the gastrocnemius and soleus muscles, has been shown to reduce the incidence and severity of nighttime leg cramps in some populations (Miller et al., 2021).

Despite some evidence suggesting the benefit of stretching, other studies indicate that such interventions may not consistently reduce the frequency or intensity of nighttime leg cramps (Alimoradi et al., 2024). Activating antagonist muscles, such as dorsiflexion of the ankle for a calf discomfort, can also help to break the spasm. Local heat application before sleep can also mitigate nighttime discomforts, particularly in elderly individuals (Acosta et al., 2021).

Apply heat by using a heating pad or take a warm bath. Apply cold by wrapping a bag of ice in a towel and apply it to the area. Take medications such as ibuprofen or acetaminophen to help with the pain. Elevate by propping up your leg after the cramp starts to feel better. You can also try walking around on your heels. There are not any recommended medications that can prevent the discomforts 100% of the time.

However, some prescription medications show a little evidence of preventing leg cramps.

Lifestyle modifications may also encompass dietary adjustments, including adequate intake of magnesium and potassium, although robust scientific evidence supporting the efficacy of these supplements for cramp prophylaxis remains inconclusive (Joensuu et al., 2021). Under the direction of your healthcare provider, you might want to try Carisoprodol, Diltiazem, Orphenadrine, Verapamil, Gabapentin, Magnesium, or Vitamin B complex. No vitamin is likely to help with the discomfort 100% of the time.

But some experts do recommend that you take a vitamin B complex or magnesium for leg cramps. Magnesium supplements, despite being a common recommendation for the discomforts, lack conclusive evidence of efficacy across various populations, with some studies showing limited benefit for idiopathic or pregnancy-related discomforts, while others indicate no significant improvement (Zhou et al., 2015). Although magnesium supplementation has shown limited benefit for short-term treatment of idiopathic or pregnancy-related nighttime discomforts, magnesium oxide might offer some improvement after 60 days of consistent use (Kaufman et al., 2023).

Some research suggests that magnesium oxide monohydrate may increase intracellular magnesium levels, potentially offering a benefit over other forms of magnesium, especially in cases where cellular accumulation is a limiting factor (Barna et al., 2021). Leg cramps do not have a cure at this time. Fortunately, there are steps you can take to prevent and manage your discomforts.

It depends on the person.

Some people see improvement with prevention and treatment plans, while others struggle. Your cramps may feel worse and happen more often as you age. Planning is key. Work with your healthcare provider to develop a prevention plan that gives you lifestyle tips to keep a discomfort from happening. An in-the-moment treatment plan that tells you what to do when a discomfort strikes.

Therefore, a personalized approach to leg cramp management, integrating evidence-based strategies with individual patient characteristics and preferences, is often necessary to achieve optimal outcomes. Further research is imperative to elucidate the underlying pathophysiological mechanisms of various etiologies and to develop more targeted and efficacious therapeutic interventions (Hall et al., 2025). See a healthcare provider if your discomforts are unbearably painful, happen frequently, or last for a long time.

See a healthcare provider immediately if you are concerned that your leg cramps are a symptom of an underlying serious medical condition. Go to the emergency room if the discomfort lasts longer than 10 minutes or becomes unbearably painful. The discomforts can be unpredictable and agonizing. They can affect your sleep, your exercise routine, and your general quality of life.

They are common, very normal, and temporary.

There are steps you can take to manage them. Do your best to avoid risk factors, avoid medications with leg cramps as a side effect, and take recommended preventive measures. If you are concerned about the severity and duration of your discomfort, or think a serious condition may be causing them, do not hesitate to contact your healthcare provider. Ask questions and voice your concerns.

 

References
Acosta, I., Bastías, P., & Matamala, J. M. (2021). Fasciculaciones y calambres: bases fisiológicas y enfrentamiento clínico de un fenómeno complejo. Revista Médica de Chile, 149(12), 1751. Q16635223. https://doi.org/10.4067/s0034-98872021001201751

Alimoradi, M., Hosseini, E., & Konrad, A. (2024). A scoping review of the effect of chronic stretch training on sleep quality in people with sleep disorders. European Journal of Applied Physiology, 124(9), 2533. Springer Science+Business Media. https://doi.org/10.1007/s00421-024-05541-z

Barna, O., Lohoida, P., Holovchenko, Y., Bazylevych, A., Velychko, V. I., Hovbakh, I., Bula, L., & Shechter, M. (2021). A Randomized, Double-Blind, Placebo-Controlled, Multicenter Study Assessing the Efficacy of Magnesium Oxide Monohydrate in the Treatment of Nocturnal Leg Cramps. Research Square. https://doi.org/10.21203/rs.3.rs-395668/v2

Comair, M., Awad, S., & Ghosh, P. (2024). Sleep related movement disorders in the elderly: a review of recent literature. Frontiers in Sleep, 3. https://doi.org/10.3389/frsle.2024.1356644

Delacour, C., Chambe, J., Lefebvre, F., Bodot, C., Bigerel, E., Epifani, L., Granda, C., Haller, D. M., & Maisonneuve, H. (2018). Association Between Alcohol Consumption and Nocturnal Leg Cramps in Patients Over 60 Years Old: A Case-Control Study. The Annals of Family Medicine, 16(4), 296. https://doi.org/10.1370/afm.2238

Garrison, S., Allan, G. M., Sekhon, R. K., Musini, V. M., & Khan, K. (2012). Magnesium for skeletal muscle cramps. Cochrane. https://doi.org/10.1002/14651858.cd009402.pub2

Grandner, M. A., & Winkelman, J. W. (2017). Nocturnal leg cramps: Prevalence and associations with demographics, sleep disturbance symptoms, medical conditions, and cardiometabolic risk factors. PLoS ONE, 12(6). https://doi.org/10.1371/journal.pone.0178465

Hall, H., Austin, E. J., Hutchinson, K., Cheek, C., & Clay‐Williams, R. (2025). A Systematic Review of Management of Cramping Pain in Patients with Amyotrophic Lateral Sclerosis. European Neurology. https://doi.org/10.1159/000548820

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

Hawke, F., Sadler, S., Katzberg, H., Pourkazemi, F., Chuter, V., & Burns, J. (2021). Non-drug therapies for the secondary prevention of lower limb muscle cramps. Cochrane Database of Systematic Reviews, 2021(5). https://doi.org/10.1002/14651858.cd008496.pub3

Joensuu, J., Mustajoki, P., Mustonen, P., Kaila, M., & Koskela, T. (2021). Prevention of leg cramps by using compression stockings or magnesium supplements in the 50–84 age group: study protocol for a randomised controlled trial. Trials, 22(1). https://doi.org/10.1186/s13063-021-05753-0

Kaufman, N. A., White, D. W., Bull, J., Radi, R., & DeSanto, K. (2023). Does Magnesium Supplementation Treat Nocturnal Leg Cramps? PubMed, 108(6), 619. https://pubmed.ncbi.nlm.nih.gov/38215424

Li, Y., Zhu, R., Wang, L., & Tan, J. (2023). Effect of vitamin K2 in the treatment of nocturnal leg cramps in the older population: Study protocol of a randomized, double-blind, controlled trial. Frontiers in Nutrition, 10. https://doi.org/10.3389/fnut.2023.1119233

Maisonneuve, H., Chambe, J., Delacour, C., Müller, J., Rougerie, F., Haller, D. M., & Lévêque, M. (2016). Prevalence of cramps in patients over the age of 60 in primary care : a cross sectional study. BMC Family Practice, 17(1). https://doi.org/10.1186/s12875-016-0509-9

Miller, K. C., McDermott, B. P., Yeargin, S. W., Fiol, A., & Schwellnus, M. (2021). An Evidence-Based Review of the Pathophysiology, Treatment, and Prevention of Exercise-Associated Muscle Cramps. Journal of Athletic Training, 57(1), 5. https://doi.org/10.4085/1062-6050-0696.20

Miller, K. C., Stone, M. S., Huxel, K. C., & Edwards, J. E. (2010). Exercise-Associated Muscle Cramps. Sports Health A Multidisciplinary Approach, 2(4), 279. https://doi.org/10.1177/1941738109357299

Miller, T. M., & Layzer, R. B. (2005). Muscle cramps. Muscle & Nerve, 32(4), 431. https://doi.org/10.1002/mus.20341

Roy, S. (2020). Muscle cramps — a mini review of possible causes and treatment options available with a special emphasis on diabetics — a narrative review. Clinical Diabetology, 8(6), 310. https://doi.org/10.5603/dk.2019.0029

Sebo, P., Cerutti, B., & Haller, D. M. (2013). 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. https://doi.org/10.1093/fampra/cmt065

Tan, J., Zhu, R., Li, Y., Wang, L., Liao, S. F., Cheng, L., Mao, L.-Q., & Jing, D. (2024). Vitamin K2 in Managing Nocturnal Leg Cramps. JAMA Internal Medicine. https://doi.org/10.1001/jamainternmed.2024.5726

Zhou, K., West, H., Zhang, J., Xu, L., & Li, W. (2015). Interventions for leg cramps in pregnancy. Cochrane. https://doi.org/10.1002/14651858.cd010655.pub2