Table of ContentsView AllTable of ContentsCausesAre They Serious?TreatmentTreating Underlying CausesHow Cramps FeelWhen to See a Provider
Table of ContentsView All
View All
Table of Contents
Causes
Are They Serious?
Treatment
Treating Underlying Causes
How Cramps Feel
When to See a Provider
Nocturnal (nighttime) leg cramps are painful muscle contractions of the calf, thigh, or foot muscles at night that can last several seconds or minutes.They often occur without warning and while resting in bed.
Leg cramps seem to increase with age, and some studies say they affect people assigned female at birth more frequently.Pregnant people are also more likely to experience them.
Some health conditions that might cause nighttime leg cramps include nutritional deficiencies,dehydration,musculoskeletal disorders,kidney failure, nerve damage, and blood circulation problems.Leg cramps may be a side effect of some medicines, including those that increase urine output.
This article covers the causes of nighttime leg cramps, when to be concerned, managing leg cramps, treating underlying causes, and more.
MarianVejcik / Getty Images

What Causes Leg Cramps at Night?
Nighttime leg cramps are common in the general population, especially as people age. A 2023Annals of Family Medicinestudy found that 51% of primary care patients reported leg cramps.
Experts do not know what exactly causes leg cramps, but they know certain conditions and risk factors might contribute.
Pregnancy
Leg cramps are common in pregnancy.They often occur in the second and third trimesters and at night.
Researchers are not sure exactly why they affect pregnant people, but they have some possible theories.These include:
Nutritional Deficiencies
Avitaminor mineral deficiency might lead to leg cramps. This includes deficiencies of vitamins B1, B12, and D, and potassium and magnesium deficiencies.Adding these minerals and vitamins to your diet can help reduce your nightly leg cramps.
The recommended daily allowances (RDA) for adults for these vitamins and minerals are:
Potassium has an adequate intake (AI) recommendation rather than an RDA. Your RDA or AI can change based on age, sex, pregnancy, or breastfeeding status.
What Is Magnesium Deficiency?
A Note on Gender and Sex TerminologyVerywell Health acknowledges thatsex and genderare related concepts, but they are not the same. To reflect our sources accurately, this article uses terms like “female,” “male,” “woman,” and “man” as the sources use them.
A Note on Gender and Sex Terminology
Verywell Health acknowledges thatsex and genderare related concepts, but they are not the same. To reflect our sources accurately, this article uses terms like “female,” “male,” “woman,” and “man” as the sources use them.
Dehydration
Dehydration is a common cause of leg cramps.Ensure you drink at least six to eight glasses of water daily and limit your alcohol and caffeine consumption.
Varicose Veins
Varicose veinsare bulging, enlarged veins. They are considered superficial veins because they are present at the skin’s surface. While they do not always lead to serious health problems, they can cause pain with standing and walking. They can also cause nighttime leg cramps.
Additional symptoms include swelling, skin changes, leg fatigue, heaviness, and restlessness.
Nighttime Leg Cramps vs. Deep Vein Thrombosis
Musculoskeletal Disorders
Musculoskeletal disorders affect connective tissues, including bones, muscles, tendons, and ligaments. This includes arthritic conditions, includingrheumatoid arthritis(an autoimmune disease) andosteoarthritis(wear-and-tear arthritis), and musculoskeletal pain conditions likefibromyalgia(a condition of body-wide pain). Many of these conditions can cause leg cramps.
Leg cramps related to musculoskeletal disorders might occur because of physical inactivity or limited stretching.Some conditions might cause leg cramps due to reduced muscle or tendon length.
Leg Pain: Potential Causes and How to Find Relief At Home
Medication Side Effects
Leg cramps might occur as a side effect of medications, especially those that increase urine output. Some classes of medications associated with nocturnal leg cramps are:
If you suspect your medication is causing your nighttime leg cramps, let your healthcare provider know. They may be able to prescribe a different medicine that does not cause this side effect.
Risk Factors
Some risk factors are linked to nighttime leg cramps.
Risk factors include:
When Could Leg Cramps at Night be Serious?
The causes of leg cramps are often harmless, but sometimes, they are a sign of a severe health condition. If you already have one of these conditions, your leg cramps might be a symptom of that condition.
If you have not been diagnosed with one of these conditions, your nighttime leg cramps might indicate one of them. Consult with your healthcare provider if nighttime leg cramps are a frequent occurrence.
Kidney Problems
Cramps in the legs or elsewhere in the body might indicate a kidney problem.Leg cramps occur because ofimbalances in sodium, calcium, potassium, and other electrolyte levels, which may affect how muscles and nerves work. In addition to cramping, muscles might be weak and twitch.
Nerve Damage
A type of nerve damage that may cause leg cramps isdiabetic neuropathy.Leg cramps might be a sign of diabetic neuropathy resulting from ongoing high blood sugar levels. You might experience muscle cramping because of damage to small blood vessels that supply oxygen and nutrients to the nerves.
How Long It Takes Gabapentin to Treat Nerve Pain
Anemia
Severe anemia (a low number of healthy red blood cells) may cause painful lower leg cramps, especially in people with impaired blood circulation in the legs.Red blood cells deliver oxygen to the muscles and other tissues.
The large leg muscles need a lot of blood and oxygen to function properly, and the reduced amounts force them to work overtime, which leads to severe cramping.
Neurological Disorders
Neurological disorders, likeParkinson’s diseaseandamyotrophic lateral sclerosis(ALS), may cause leg cramps and muscle spasms, twitching, and weakness throughout the body.
Parkinson’s is a progressive degenerative disease of the central nervous system. ALS is a nervous system disease affecting spinal cord and brain nerve cells.
Congestive Heart Failure
Congestive heart failure happens when the heart cannot pump blood well enough to provide the body with an adequate supply.The condition may cause leg cramps if it affects blood circulation in the legs.
Steps to Take When Leg Cramps Keep You Awake
Stretching is one of the first things you can do to relieve or stop a leg cramp as soon as it strikes.
Additional ways to manage a leg cramp are:
Prevention
Quinine/Tonic WaterQuinine is a medication used to treat malaria. As a prescription drug, it has a boxed warning against using it to treat leg cramps or muscle pain due to an elevated risk for bleeding and heart rhythm disturbances.Tonic water containing quinine is sometimes promoted for easing leg cramps.Research shows quinine is moderately helpful for decreasing the frequency and intensity of muscle cramps, but it is associated with a risk of severe side effects.If you want to try quinine for managing leg cramps, let your healthcare provider know. They can review your medical history and determine whether this option is safe.
Quinine/Tonic Water
Quinine is a medication used to treat malaria. As a prescription drug, it has a boxed warning against using it to treat leg cramps or muscle pain due to an elevated risk for bleeding and heart rhythm disturbances.Tonic water containing quinine is sometimes promoted for easing leg cramps.Research shows quinine is moderately helpful for decreasing the frequency and intensity of muscle cramps, but it is associated with a risk of severe side effects.If you want to try quinine for managing leg cramps, let your healthcare provider know. They can review your medical history and determine whether this option is safe.
Quinine is a medication used to treat malaria. As a prescription drug, it has a boxed warning against using it to treat leg cramps or muscle pain due to an elevated risk for bleeding and heart rhythm disturbances.Tonic water containing quinine is sometimes promoted for easing leg cramps.
Research shows quinine is moderately helpful for decreasing the frequency and intensity of muscle cramps, but it is associated with a risk of severe side effects.If you want to try quinine for managing leg cramps, let your healthcare provider know. They can review your medical history and determine whether this option is safe.
Treating Underlying Cause of Nightly Leg Cramps
You should inform a healthcare provider if you are experiencing leg cramps due to an underlying condition, such as a neurological disorder, a heart problem, or kidney disease. Leg cramps might indicate that your current treatment plan might not be helping.
If muscle cramps do not improve with self-care and changes to your treatment plan, a healthcare provider can prescribe amuscle relaxer. These medicines are given for short periods to help with severe cramping that keeps you up at night.But muscle relaxers have side effects, including drowsiness and dizziness, which can interfere with your daily routine.
Describing How Leg Cramps at Night Feel
Nighttime leg cramps can disrupt sleep, leaving you tired in the morning. They can be painful and sometimes leave you with calf, thigh, or foot pain.
Most leg cramps start as sudden, sharp pain.They cause stiffness and twitching in and around the affected muscles. The cramp may last a few seconds or several minutes.
You may feel sore after the cramp has subsided. Some leg cramps wake you from a deep sleep or make it harder to fall asleep.
Causes of Muscle Spasms and Cramps
Nighttime Leg Cramps vs. Restless Legs Syndrome
Restless legs syndrome (RLS)might be confused with nighttime leg cramps, but the conditions are easily distinguishable.
The most common symptom of RLS is the urge to move the legs while trying to fall asleep.That urge will last much longer than a leg cramp, and while RLS can cause discomfort, it is not painful.
When to See a Healthcare Provider
Leg cramps are usually a harmless problem that can be managed. But sometimes, they might be related to an underlying health problem.
Let your healthcare provider know if you are experiencing severe or frequent leg cramps or leg cramps that affect your sleep on most nights. They can review your medical history and request testing to determine the cause of leg cramps.
Summary
A leg cramp is a sudden, painful, and involuntary muscle contraction in the foot, calf, or thigh. Leg cramps can last from several seconds to several minutes. While painful, most leg cramps are harmless and associated with overexertion, dehydration, and inactivity. People older than 60 assigned female at birth are more likely to experience leg cramps.
Leg cramps are common in pregnant people and people with musculoskeletal conditions. Leg cramps might also indicate a more severe condition, such as neuromuscular or kidney disease or a heart or circulation problem. They might also be a side effect of some medications.
Let your healthcare provider know if you are experiencing severe or frequent leg cramps or if leg cramps are disrupting your sleep. They can adjust your treatment plan for any underlying condition or request testing to determine the source of leg cramps.
18 SourcesVerywell Health uses only high-quality sources, including peer-reviewed studies, to support the facts within our articles. Read oureditorial processto learn more about how we fact-check and keep our content accurate, reliable, and trustworthy.Hallegraeff J, de Greef M, Krijnen W, van der Schans C.Criteria in diagnosing nocturnal leg cramps: a systematic review.BMC Fam Pract. 2017;18(1):29. doi:10.1186/s12875-017-0600-xKhandalavala B, Geske J, Klein J.Patient-reported prevalence, characteristics, and impact of leg cramps in an urban primary care clinic.Ann Fam Med. 2023;21(5):440-443. doi:10.1370/afm.3013Luo L, Zhou K, Zhang J, Xu L, Yin W.Interventions for leg cramps in pregnancy.Cochrane Database Syst Rev. 2020;12(12):CD010655. doi:10.1002/14651858.CD010655.pub3Godswill AG, Somtochukwu IV, Ikechukwu AO, Kate EC.Health benefits of micronutrients (vitamins and minerals) and their associated deficiency diseases: a systematic review.IJF. 2020;3(1):1-32. doi:10.47604/ijf.1024Office of Dietary Supplements.Potassium.Office of Dietary SupplementsMagnesium-consumer.Harvard Health Publishing.Take that, muscle cramps!DePopas E, Brown M.Varicose veins and lower extremity venous insufficiency.Semin Intervent Radiol. 2018;35(1):56-61. doi:10.1055/s-0038-1636522Centers for Disease Control and Prevention.What is venous thromboembolism?Garrison SR, Dormuth CR, Morrow RL, Carney GA, Khan KM.Nocturnal leg cramps and prescription use that precedes them: a sequence symmetry analysis.Arch Intern Med. 2012;172(2):120-6. doi:10.1001/archinternmed.2011.1029 (although over 10 years old, is best source for this info)Caravaca F, Gonzales B, Bayo MÁ, Luna E.Musculoskeletal pain in patients with chronic kidney disease. Dolor músculo-esquelético en pacientes con enfermedad renal crónica.Nefrologia. 2016;36(4):433-440. doi:10.1016/j.nefro.2016.03.024Johns Hopkins Medicine.Diabetic neuropathy.Texas Medical Institute.10 symptoms of anemia you shouldn’t ignore.Hawke F, Sadler SG, Katzberg HD, Pourkazemi F, Chuter V, Burns J.Non-drug therapies for the secondary prevention of lower limb muscle cramps.Cochrane Database Syst Rev. 2021;5(5):CD008496. doi:10.1002/14651858.CD008496.pub3Harvard Health Publishing.How to get rid of muscle cramps in your legs.Saguil, A, Lauters R.Quinine for leg cramps.Am Fam Physician.2016;93(3):177-178.MedlinePlus.Muscle spasms.National Institute of Neurological Disorders and Stroke.Restless legs syndrome.
18 Sources
Verywell Health uses only high-quality sources, including peer-reviewed studies, to support the facts within our articles. Read oureditorial processto learn more about how we fact-check and keep our content accurate, reliable, and trustworthy.Hallegraeff J, de Greef M, Krijnen W, van der Schans C.Criteria in diagnosing nocturnal leg cramps: a systematic review.BMC Fam Pract. 2017;18(1):29. doi:10.1186/s12875-017-0600-xKhandalavala B, Geske J, Klein J.Patient-reported prevalence, characteristics, and impact of leg cramps in an urban primary care clinic.Ann Fam Med. 2023;21(5):440-443. doi:10.1370/afm.3013Luo L, Zhou K, Zhang J, Xu L, Yin W.Interventions for leg cramps in pregnancy.Cochrane Database Syst Rev. 2020;12(12):CD010655. doi:10.1002/14651858.CD010655.pub3Godswill AG, Somtochukwu IV, Ikechukwu AO, Kate EC.Health benefits of micronutrients (vitamins and minerals) and their associated deficiency diseases: a systematic review.IJF. 2020;3(1):1-32. doi:10.47604/ijf.1024Office of Dietary Supplements.Potassium.Office of Dietary SupplementsMagnesium-consumer.Harvard Health Publishing.Take that, muscle cramps!DePopas E, Brown M.Varicose veins and lower extremity venous insufficiency.Semin Intervent Radiol. 2018;35(1):56-61. doi:10.1055/s-0038-1636522Centers for Disease Control and Prevention.What is venous thromboembolism?Garrison SR, Dormuth CR, Morrow RL, Carney GA, Khan KM.Nocturnal leg cramps and prescription use that precedes them: a sequence symmetry analysis.Arch Intern Med. 2012;172(2):120-6. doi:10.1001/archinternmed.2011.1029 (although over 10 years old, is best source for this info)Caravaca F, Gonzales B, Bayo MÁ, Luna E.Musculoskeletal pain in patients with chronic kidney disease. Dolor músculo-esquelético en pacientes con enfermedad renal crónica.Nefrologia. 2016;36(4):433-440. doi:10.1016/j.nefro.2016.03.024Johns Hopkins Medicine.Diabetic neuropathy.Texas Medical Institute.10 symptoms of anemia you shouldn’t ignore.Hawke F, Sadler SG, Katzberg HD, Pourkazemi F, Chuter V, Burns J.Non-drug therapies for the secondary prevention of lower limb muscle cramps.Cochrane Database Syst Rev. 2021;5(5):CD008496. doi:10.1002/14651858.CD008496.pub3Harvard Health Publishing.How to get rid of muscle cramps in your legs.Saguil, A, Lauters R.Quinine for leg cramps.Am Fam Physician.2016;93(3):177-178.MedlinePlus.Muscle spasms.National Institute of Neurological Disorders and Stroke.Restless legs syndrome.
Verywell Health uses only high-quality sources, including peer-reviewed studies, to support the facts within our articles. Read oureditorial processto learn more about how we fact-check and keep our content accurate, reliable, and trustworthy.
Hallegraeff J, de Greef M, Krijnen W, van der Schans C.Criteria in diagnosing nocturnal leg cramps: a systematic review.BMC Fam Pract. 2017;18(1):29. doi:10.1186/s12875-017-0600-xKhandalavala B, Geske J, Klein J.Patient-reported prevalence, characteristics, and impact of leg cramps in an urban primary care clinic.Ann Fam Med. 2023;21(5):440-443. doi:10.1370/afm.3013Luo L, Zhou K, Zhang J, Xu L, Yin W.Interventions for leg cramps in pregnancy.Cochrane Database Syst Rev. 2020;12(12):CD010655. doi:10.1002/14651858.CD010655.pub3Godswill AG, Somtochukwu IV, Ikechukwu AO, Kate EC.Health benefits of micronutrients (vitamins and minerals) and their associated deficiency diseases: a systematic review.IJF. 2020;3(1):1-32. doi:10.47604/ijf.1024Office of Dietary Supplements.Potassium.Office of Dietary SupplementsMagnesium-consumer.Harvard Health Publishing.Take that, muscle cramps!DePopas E, Brown M.Varicose veins and lower extremity venous insufficiency.Semin Intervent Radiol. 2018;35(1):56-61. doi:10.1055/s-0038-1636522Centers for Disease Control and Prevention.What is venous thromboembolism?Garrison SR, Dormuth CR, Morrow RL, Carney GA, Khan KM.Nocturnal leg cramps and prescription use that precedes them: a sequence symmetry analysis.Arch Intern Med. 2012;172(2):120-6. doi:10.1001/archinternmed.2011.1029 (although over 10 years old, is best source for this info)Caravaca F, Gonzales B, Bayo MÁ, Luna E.Musculoskeletal pain in patients with chronic kidney disease. Dolor músculo-esquelético en pacientes con enfermedad renal crónica.Nefrologia. 2016;36(4):433-440. doi:10.1016/j.nefro.2016.03.024Johns Hopkins Medicine.Diabetic neuropathy.Texas Medical Institute.10 symptoms of anemia you shouldn’t ignore.Hawke F, Sadler SG, Katzberg HD, Pourkazemi F, Chuter V, Burns J.Non-drug therapies for the secondary prevention of lower limb muscle cramps.Cochrane Database Syst Rev. 2021;5(5):CD008496. doi:10.1002/14651858.CD008496.pub3Harvard Health Publishing.How to get rid of muscle cramps in your legs.Saguil, A, Lauters R.Quinine for leg cramps.Am Fam Physician.2016;93(3):177-178.MedlinePlus.Muscle spasms.National Institute of Neurological Disorders and Stroke.Restless legs syndrome.
Hallegraeff J, de Greef M, Krijnen W, van der Schans C.Criteria in diagnosing nocturnal leg cramps: a systematic review.BMC Fam Pract. 2017;18(1):29. doi:10.1186/s12875-017-0600-x
Khandalavala B, Geske J, Klein J.Patient-reported prevalence, characteristics, and impact of leg cramps in an urban primary care clinic.Ann Fam Med. 2023;21(5):440-443. doi:10.1370/afm.3013
Luo L, Zhou K, Zhang J, Xu L, Yin W.Interventions for leg cramps in pregnancy.Cochrane Database Syst Rev. 2020;12(12):CD010655. doi:10.1002/14651858.CD010655.pub3
Godswill AG, Somtochukwu IV, Ikechukwu AO, Kate EC.Health benefits of micronutrients (vitamins and minerals) and their associated deficiency diseases: a systematic review.IJF. 2020;3(1):1-32. doi:10.47604/ijf.1024
Office of Dietary Supplements.Potassium.
Office of Dietary SupplementsMagnesium-consumer.
Harvard Health Publishing.Take that, muscle cramps!
DePopas E, Brown M.Varicose veins and lower extremity venous insufficiency.Semin Intervent Radiol. 2018;35(1):56-61. doi:10.1055/s-0038-1636522
Centers for Disease Control and Prevention.What is venous thromboembolism?
Garrison SR, Dormuth CR, Morrow RL, Carney GA, Khan KM.Nocturnal leg cramps and prescription use that precedes them: a sequence symmetry analysis.Arch Intern Med. 2012;172(2):120-6. doi:10.1001/archinternmed.2011.1029 (although over 10 years old, is best source for this info)
Caravaca F, Gonzales B, Bayo MÁ, Luna E.Musculoskeletal pain in patients with chronic kidney disease. Dolor músculo-esquelético en pacientes con enfermedad renal crónica.Nefrologia. 2016;36(4):433-440. doi:10.1016/j.nefro.2016.03.024
Johns Hopkins Medicine.Diabetic neuropathy.
Texas Medical Institute.10 symptoms of anemia you shouldn’t ignore.
Hawke F, Sadler SG, Katzberg HD, Pourkazemi F, Chuter V, Burns J.Non-drug therapies for the secondary prevention of lower limb muscle cramps.Cochrane Database Syst Rev. 2021;5(5):CD008496. doi:10.1002/14651858.CD008496.pub3
Harvard Health Publishing.How to get rid of muscle cramps in your legs.
Saguil, A, Lauters R.Quinine for leg cramps.Am Fam Physician.2016;93(3):177-178.
MedlinePlus.Muscle spasms.
National Institute of Neurological Disorders and Stroke.Restless legs syndrome.
Meet Our Medical Expert Board
Share Feedback
Was this page helpful?Thanks for your feedback!What is your feedback?OtherHelpfulReport an ErrorSubmit
Was this page helpful?
Thanks for your feedback!
What is your feedback?OtherHelpfulReport an ErrorSubmit
What is your feedback?