Our Services
Medical Information
Helpful Resources
Published on: 3/13/2026
Nighttime leg cramps, or Charley horses, are common and usually harmless; for fast relief, gently stretch by pulling your toes toward your shin, massage, apply heat, and take a short walk, then prevent them with nightly calf stretches, steady hydration, medication review, and keeping feet neutral in bed.
There are several factors and red flags to consider; see below for step-by-step stretches, when magnesium might help, what to avoid like quinine, tailored tips for pregnancy and older adults, and when to seek care for frequent cramps, leg swelling, redness or warmth, weakness, numbness, color changes, or suspected blood clot.
Leg cramps at night—often called Charley horses—can wake you up with sudden, intense pain in your calf, foot, or thigh. The muscle tightens and hardens, sometimes lasting a few seconds, sometimes several minutes. Even after the cramp stops, soreness can linger into the next day.
Nighttime leg cramps are common, especially in adults over 50, pregnant women, and people who stand or sit for long periods. In most cases, they're not dangerous—but they can seriously disrupt sleep and quality of life.
Here's what causes leg cramps at night, how to stop them fast, and what you can do to prevent them.
In many cases, there's no single clear cause. Doctors call this idiopathic nocturnal leg cramps. However, several factors are strongly linked to nighttime muscle cramps:
Medical conditions that may contribute include:
Most nighttime leg cramps are not life-threatening. However, frequent or severe cramps should not be ignored.
When a Charley horse strikes, act quickly. The goal is to gently stretch and relax the muscle.
1. Stretch the muscle
2. Massage the muscle
3. Apply heat
4. Walk it off
5. Stay calm
Avoid aggressively forcing the stretch. Sudden jerking movements can strain the muscle further.
Prevention is often more effective than treatment. These evidence-based strategies can reduce the frequency of nighttime leg cramps.
Daily stretching, especially of the calves and hamstrings, can significantly reduce leg cramps at night.
Try this simple bedtime routine:
Do this consistently for best results.
Dehydration can trigger muscle cramps. Aim for steady fluid intake throughout the day.
If you have kidney or heart conditions, speak to your doctor before increasing fluids.
Low magnesium may contribute to leg cramps at night, especially in pregnancy.
Magnesium supplements may help some people, but evidence is mixed. Do not start supplements without discussing them with your doctor—especially if you have kidney disease.
Routine potassium supplements are not recommended unless prescribed.
If leg cramps began after starting a new medication, talk to your doctor.
Do not stop medications on your own. But it's reasonable to ask:
Poor blood flow can worsen leg cramps at night.
Helpful habits include:
If you smoke, quitting can significantly improve circulation.
Some people point their toes downward while sleeping, which shortens the calf muscle.
You can:
Most nighttime leg cramps are harmless. But you should speak to a doctor if you notice:
A blood clot (deep vein thrombosis) is different from a typical Charley horse. A clot often causes:
If you suspect a blood clot, seek urgent medical care.
Leg cramps at night are very common in the second and third trimesters. Gentle stretching, hydration, and magnesium (if approved by your doctor) may help.
Muscle loss, nerve changes, and circulation issues increase risk. Regular movement and strength training can help reduce cramps.
Overtraining without recovery increases nighttime cramps. Balance exercise with rest.
Speak to a doctor if:
If you're experiencing recurring nighttime leg cramps and want to better understand what might be causing them, try Ubie's free AI-powered Calf cramp (Charley Horse) symptom checker to get personalized insights about your symptoms and potential next steps.
However, an online tool is not a diagnosis. It does not replace medical care.
Always speak to a doctor about symptoms that could be serious or life-threatening.
Nighttime leg cramps can be painful and frustrating, but they are often manageable with simple, consistent changes. If they're interfering with your sleep or becoming more intense, don't ignore them. A thoughtful evaluation can rule out serious causes and help you find lasting relief.
And if you're ever unsure, speak to a doctor.
(References)
* Guay DRP. Nocturnal Leg Cramps: a Narrative Review of Pharmacologic and Nonpharmacologic Treatments. Consult Pharm. 2021 Apr 1;36(4):187-195. doi: 10.4140/TCP.n.2021.187. PMID: 33766465.
* Miller KC, O'Connor MP. Nocturnal Leg Cramps: A Common and Debilitating Problem. Curr Sports Med Rep. 2017 Mar/Apr;16(2):117-124. doi: 10.1249/JSR.0000000000000342. PMID: 28272990.
* Di Bari R, Lenti C, Di Felice F, Di Giorgio S, Di Filippo P, Sestini P, Di Gregorio E. Treatment of muscle cramps: evidence from 27 randomized controlled trials. Eur J Clin Pharmacol. 2023 Apr;79(4):479-491. doi: 10.1007/s00228-023-03460-5. Epub 2023 Feb 21. PMID: 36813876.
* Young G, Young GK. Nocturnal leg cramps. Aust Prescr. 2019 Oct;42(5):151-154. doi: 10.18773/austprescr.2019.055. PMID: 31589139; PMCID: PMC6789726.
* Allen RE, Kirby KA. Nonpharmacologic approaches to the treatment of nocturnal leg cramps. P T. 2012 Aug;37(8):480-5. PMID: 22896898.
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.