Our Services
Medical Information
Helpful Resources
Published on: 9/10/2026
Nighttime muscle cramps, often called nocturnal leg cramps, are usually caused by dehydration, mineral imbalances involving potassium, magnesium, calcium or sodium, prolonged sitting or standing, overexertion during the day, or sleeping in positions that shorten the calf muscles. Less commonly, they signal an underlying issue such as poor circulation, nerve compression, diabetes, thyroid or kidney problems, pregnancy, or side effects from medications like diuretics and statins. Stretching before bed, staying hydrated, loosening bedding, and gentle massage or heat can ease most episodes, while cramps that are frequent, severe, or paired with swelling, numbness, or muscle weakness deserve medical attention. There are several important distinctions between harmless cramps and warning signs, so see below to understand more.
Because the same nighttime cramping can point to something as simple as low fluids or as serious as a circulation or nerve condition, guessing rarely gives you the clarity you need. A free, instant, online symptom check lets you enter your specific symptoms, medications, and health history in minutes, then shows you possible causes and which type of doctor to see next, so you can stop losing sleep and start addressing the real reason behind it.
Last reviewed for medical accuracy: 09/10/2026
Waking up in the middle of the night with a sudden, sharp ache in your calf or foot can be unsettling. Nighttime muscle cramps—often called “charley horses”—are common and usually harmless. Understanding what triggers them and how to prevent or ease them can help you get a more comfortable night’s sleep.
Muscle cramps are involuntary, forceful contractions of one or more muscles. They can last from a few seconds to several minutes and range in intensity from mild discomfort to severe pain. When they occur at night, they may disrupt sleep and leave lingering soreness.
Although the exact reason for nighttime cramps isn’t always clear, several factors can contribute:
Dehydration
Inadequate fluid intake can upset the balance of electrolytes (sodium, potassium, calcium, magnesium) needed for normal muscle function.
Electrolyte imbalances
Low levels of key minerals interfere with muscle contraction and relaxation.
Overuse or muscle fatigue
Excessive exercise, standing for long periods, or working muscles hard during the day can lead to cramping at rest.
Poor circulation
Restricted blood flow to your legs—due to peripheral artery disease or sitting in one position too long—can trigger cramps.
Nerve compression
Conditions like spinal stenosis can pinch nerves in your back, causing leg pain and cramps, especially at night.
Medications
Diuretics, statins, and certain asthma or blood pressure drugs may raise your risk of cramps.
Pregnancy
Changes in circulation and increased weight put extra stress on leg muscles.
Aging
Muscle mass and hydration levels tend to decline with age, making cramps more likely in older adults.
Certain groups of people report nighttime muscle cramps more often:
If you fall into one of these categories, pay special attention to lifestyle habits and home remedies that may help.
You don’t have to accept nighttime cramps as inevitable. Try these strategies:
Gentle calf and hamstring stretches before bed:
Hold each stretch for 20–30 seconds; repeat 2–3 times.
Most nighttime cramps are benign and improve with self-care. However, see your doctor if you experience:
If you’re unsure how serious your symptoms are, consider a free, online symptom check, using the doctor approved Ubie Symptom Checker. It can help you decide whether you need to see a healthcare professional.
Your doctor may want to check for:
Early diagnosis and management of these conditions can reduce cramp frequency and improve overall health.
Nighttime muscle cramps can often be prevented by:
Most cramps are harmless, but if they become frequent or severe, it’s wise to get medical advice. For an easy way to assess your symptoms, try a free, online symptom check, using the doctor approved Ubie Symptom Checker.
If you experience any serious signs—like sudden swelling, persistent pain, numbness, or weakness—please speak to a doctor as soon as possible. Your health and peace of mind are important.
(References)
* Night cramp. Br Med J. 1976 Dec 25;2(6051):1563. PMID: 1009408; PMCID: PMC1690103.
* Jacobsen JH, Rosenberg RS, Huttenlocher PR, Spire JP. Familial nocturnal cramping. Sleep. 1986;9(1):54-60. doi: 10.1093/sleep/9.1.54. PMID: 3961367.
* Nocturnal leg cramps. Postgrad Med. 2002 Feb;111(2):125-6. doi: 10.3810/pgm.2002.02.1123. PMID: 11868309.
* FIELDS A. Leg cramps. Calif Med. 1960 Mar;92(3):204-6. PMID: 13822692; PMCID: PMC1578136.
* Young G. Leg cramps. BMJ Clin Evid. 2009 Mar 26;2009. Epub 2009 Mar 26. PMID: 19445755; PMCID: PMC2907778.
* Young G. Leg cramps. BMJ Clin Evid. 2015 May 13;2015. Epub 2015 May 13. PMID: 25970567; PMCID: PMC4429847.
* Garrison SR, Korownyk CS, Kolber MR, Allan GM, Musini VM, Sekhon RK, Dugré N. Magnesium for skeletal muscle cramps. Cochrane Database Syst Rev. 2020 Sep 21;9(9):CD009402. doi: 10.1002/14651858.CD009402.pub3. Epub 2020 Sep 21. PMID: 32956536; PMCID: PMC8094171.
* Kaufman N, White D, Bull J, Radi R, DeSanto K. Does Magnesium Supplementation Treat Nocturnal Leg Cramps? Am Fam Physician. 2023 Dec;108(6):619-620. PMID: 38215424.
* Devine H, Solomons M, Zampedri L, Hanna MG, Rinaldi C, Fratta P, Jayaseelan D. Kennedy's disease. Pract Neurol. 2024 Jul 16;24(4):302-305. doi: 10.1136/pn-2023-004041. Epub 2024 Jul 16. PMID: 38485225.
* Tan J, Zhu R, Li Y, Wang L, Liao S, Cheng L, Mao L, Jing D. Vitamin K2 in Managing Nocturnal Leg Cramps: A Randomized Clinical Trial. JAMA Intern Med. 2024 Dec 1;184(12):1443-1447. doi: 10.1001/jamainternmed.2024.5726. PMID: 39466236; PMCID: PMC11581596.
We would love to help them too.
For First Time Users
We provide a database of explanations from real doctors on a range of medical topics. Get started by exploring our library of questions and topics you want to learn more about.
Was this page helpful?
Purpose and positioning of servicesUbie Doctor's Note is a service for informational purposes. The provision of information by physicians, medical professionals, etc. is not a medical treatment. If medical treatment is required, please consult your doctor or medical institution. We strive to provide reliable and accurate information, but we do not guarantee the completeness of the content. If you find any errors in the information, please contact us.