Download Loosn

QR code linking to Loosn on the App Store

Scan the QR code to download the app

Compatible with

Download Loosn

QR code linking to Loosn on the App Store

Scan the QR code to download the app

Compatible with

Pain Science10 min read

Leg Cramps at Night: Why They Happen, What Helps and When to See a Provider

Why night leg cramps happen, what helps, what the evidence says about magnesium, pickle juice and quinine, and when to see a provider.


Written by:
Dr. Jossy Onwude, MD
Medically reviewed by:
Michael Patel, DPT
LAST UPDATED:
A lady in bed holding the muscle at the back of the lower leg that tightened during sleep
Table of content

You are asleep, and then you are not. A calf has locked into a hard knot, your toes are curling and the only thing that matters is getting that foot flexed. If this sounds familiar, you are in large company. Night leg cramps are common, often harmless and usually have no clear cause. A few patterns, though, call for a visit. This guide explains what is known, what helps, what has not held up and the signs that should not wait.

The short answer: Night leg cramps are common and often harmless, and most have no known cause. Stretching your calves and hamstrings before bed has the most support among home steps, though evidence is limited. Magnesium has not been shown to help older adults, and quinine should not be used. See a provider for a swollen, red, warm leg, weakness or frequent cramps.

Key takeaways

  • Most night cramps have no known cause. The American Academy of Family Physicians (AAFP) says 50 to 60 percent of adults report them.
  • In our reading, stretching is the best-supported home step, with limits. One trial in adults over 55 found nightly stretching helped, and the AAFP rates the overall evidence as limited.
  • Do not rely on supplements. A Cochrane review found magnesium unlikely to help older adults, and I found no good evidence for pickle juice.
  • Never use quinine for cramps. The FDA says its risks outweigh any benefit.
  • One painful, swollen, warm or red leg is different. That can be a blood clot and needs same-day care.

What are night leg cramps, and how common are they?

A night leg cramp is a sudden, painful tightening of a leg muscle during sleep. The AAFP says it usually hits the back of the calf, though the foot and thigh can cramp too. Mayo Clinic says it often wakes you with a jolt.

The AAFP says episodes last about nine minutes on average, may be followed by more cramps and soreness for hours and can lead to poor sleep. It says 50 to 60 percent of adults report night leg cramps, they are slightly more common in women and they become more common with age. Up to 20 percent of people with them have daily symptoms bothersome enough to seek care.

Is it a cramp or restless legs? Mayo Clinic says restless legs syndrome is an urge to move the legs when falling asleep, usually not painful, and it lasts longer. A cramp is a sudden, hard, painful knot. If your problem is an urge to move, tell your provider, because it is treated differently.

What causes leg cramps at night?

Honest answer: usually we do not know. The AAFP says most cases are idiopathic, meaning no cause is found. Mayo Clinic says they are likely related to tired muscles and nerve issues. The AAFP notes proposed mechanisms include overactive nerve signals to the muscle and muscle fatigue.

The sources disagree on one popular belief, electrolytes:

Scroll table sidewaysSwipe →

Our reading: staying well hydrated is sensible and low-risk, but I would not assume your cramps come from a low mineral level. A blood test is mostly useful when a provider suspects a specific problem.

Who is more likely to get them? Mayo Clinic lists increasing age and pregnancy as risk factors. It also lists lack of physical activity, muscle fatigue and dialysis among common causes. It says some medical conditions are linked, including diabetes, thyroid problems, anemia, kidney disease, Parkinson's disease, peripheral neuropathy, spinal stenosis, high blood pressure, peripheral artery disease, cirrhosis and alcohol use disorder. Mayo says people with kidney failure, diabetic nerve damage or blood flow problems usually have other symptoms too. The AAFP reports high rates of cramps in people with peripheral vascular disease and says that pregnancy is hard to separate from vein problems as a cause.

If you have any of these conditions and your cramps are new, frequent or changing, mention it at your next visit.

Can my medicines cause night leg cramps?

Some can. Mayo Clinic lists birth control pills and medicines for blood pressure or high cholesterol, and says medicines that increase urine output may raise risk, though a direct link is unknown. The AAFP lists IV iron sucrose (23 percent of users in the data it cites), conjugated estrogens (3.5 to 14 percent), raloxifene (5.9 to 12.1 percent), naproxen (3 percent) and teriparatide (2.6 percent).

Do not stop a prescription on your own. If your cramps began soon after a new medicine or a dose change, tell your prescriber and ask whether it could be related. I did not find a US source on cramps and weight-loss injections, so I will not guess. Ask the prescriber.

What helps a cramp right now?

Try these in order. The sources are named so you can see where each comes from.

  1. Stretch the muscle. Mayo Clinic says to stretch the leg and flex your foot up toward your face. MedlinePlus says stretching or gentle massage usually helps.
  2. Stand and put weight on the leg, or walk it off. Mayo Clinic lists walking or shaking the leg.
  3. Add heat or ice. MedlinePlus says to use heat while the muscle is tight and ice once it is sore. Mayo Clinic lists a hot shower aimed at the cramped muscle, a warm bath, or massaging the muscle with ice.
  4. Rest, then check. Once it settles, check the calf. If it is swollen, red or warm, see the red-flag section below.

The MedlinePlus encyclopedia also says to take NSAIDs if the muscle is still sore. The AAFP says no evidence supports NSAIDs for routine cramp prevention, and lists naproxen among medicines that can cause cramps. These are not the same question: one is for soreness after a cramp, the other for preventing the next one. Ask a pharmacist whether NSAIDs are safe for you, since they are not for everyone.

How can I prevent night leg cramps?

Evidence is limited, and no single step is proven. Here is what the sources say.

  • Stretch before bed. Mayo Clinic and MedlinePlus both say to stretch your leg muscles before bed. In a Dutch randomized trial of 80 adults over 55, daily calf and hamstring stretching just before sleep for six weeks reduced cramps by 1.2 per night more than no stretching, and cut pain by 1.3 centimeters on a 10-centimeter pain scale. That is one small trial, and the abstract does not say how long each stretch was held. The AAFP says stretching may be suggested as a trial, gives it its weakest recommendation grade (C) and notes one trial in people stopping quinine where it did not help.
A person stretching with arms crossed sideways over the chest
A person stretching with arms crossed sideways over the chest
  • A few minutes of easy activity. Mayo Clinic says to stretch or ride a stationary bicycle for a few minutes before bed.
  • Drink fluids. Mayo Clinic advises plenty of fluids, with less alcohol and caffeine.
  • Loosen the covers. Mayo Clinic says to loosen sheets and blankets at the foot of the bed.
  • Build leg fitness gradually. The AAFP says that if muscle fatigue is a cause, graded exercise or physical therapy may help some people. Our reading: that fits with Mayo's lack-of-activity point, but no source tests it for night cramps.

What about magnesium, pickle juice and other remedies?

Magnesium. A 2020 Cochrane review pooled 11 trials with 735 people. For cramps with no known cause, in older adults (average ages about 62 to 69), magnesium did not meaningfully reduce cramps compared with placebo, and the review's authors concluded it is unlikely to give clinically meaningful prevention. For pregnancy cramps, the evidence conflicted and was very low certainty. Side effects were mostly digestive, such as diarrhea. The AAFP says magnesium shows mixed benefit in people who are not pregnant.

Pickle juice. A Houston Methodist sports medicine physician says reports are anecdotal and any benefit is likely the power of suggestion. That page is about exercise cramps, not sleep. I found no night-cramp evidence.

Other medicines. The AAFP says some prescription drugs may help a few people, such as gabapentin and diltiazem, but the evidence is low quality and none is recommended for routine use. Talk with a provider before trying any.

Quinine. Do not use it. The FDA states that quinine (Qualaquin) is not approved for night-time leg cramps and that its risks outweigh any benefit. The risks include serious, life-threatening blood reactions, low platelets with bleeding, kidney damage and death in some patients. The FDA says to talk to a health care professional about other options if you are taking it for cramps, and to get help right away for easy bruising, severe nosebleeds, blood in urine or stool or bleeding gums.

What exercises can I do before bed?

Here is a short routine using moves we have pages for. The doses are our suggestion, since the trial's abstract did not give hold times. Go slowly and stop short of pain.

Scroll table sidewaysSwipe →

Stop if you feel sharp pain, a tearing feeling, new numbness or tingling, or calf swelling or redness. For tight muscles in general, see our muscle stiffness glossary entry. If cramps are part of a wider sleep problem, see pain and sleep: why bad nights make pain worse. If balance or falls are a worry at night, see balance exercises over 50.

What will a provider do if I go?

The AAFP says a history and physical exam are the main tools. A clinician will ask when cramps happen, what medicines you take and look for conditions such as vascular disease, nerve problems and vein problems, and may check your blood pressure. The AAFP says routine blood tests do not help diagnose cramps, but selected tests can make sense when a specific condition is suspected, such as B12 for nerve problems. Bring a list of your medicines and a simple cramp diary: how often, which muscle, how long, what time.

When to get medical help

Loosn gives no diagnosis. This list combines CDC, Mayo Clinic, MedlinePlus and AAFP guidance with standard red flags. The tiering is ours.

Emergency: call 911 or go to the emergency room if:

  • you have sudden shortness of breath, chest pain (often worse with a deep breath), coughing up blood, a racing or irregular heartbeat, or you feel faint, especially with a swollen or painful leg (CDC lists these as blood clot warning signs and says to get medical help immediately)

Get seen the same day or within a day or two if (our tiering):

  • one leg is swollen, tender, warm or red, especially after travel, surgery or long bed rest (CDC lists swelling, pain or tenderness, warmth and redness as signs of a deep vein clot, and says about half of people have no symptoms; MedlinePlus lists swelling, redness or warmth as reasons to call)
  • you have severe cramping that keeps going and does not ease with stretching, or cramps after contact with a toxin such as pesticides, industrial chemicals or heavy metals (Mayo Clinic says to seek care right away)
  • you have new muscle weakness, muscle loss or skin changes with the cramps (Mayo Clinic, MedlinePlus)

See your provider soon if:

  • cramps are frequent, severe, last a long time or do not improve with stretching and fluids (MedlinePlus)
  • cramps leave you tired in the daytime (Mayo Clinic)
  • cramps began soon after a new medicine or a dose change (our tiering)
  • you have diabetes, kidney, thyroid, nerve or circulation problems and cramps are new or changing

Loosn is not a substitute for assessment when symptoms are severe, getting worse or unusual.

FAQ

Why do I get leg cramps at night? 

Most of the time no one knows. The American Academy of Family Physicians says most nocturnal leg cramps have no identified cause, and Mayo Clinic says tired muscles and nerve issues are likely. Some conditions and medicines raise the risk, and cramps are more common with age and in pregnancy. See a provider if they are frequent, severe or come with weakness.

How do I stop a leg cramp right now? 

Mayo Clinic says to stretch the leg and flex your foot up toward your face. MedlinePlus says to stretch or gently massage the muscle, with heat while it is tight and ice once it is sore. Mayo Clinic also lists walking or shaking the leg, a hot shower aimed at the muscle or a warm bath.

Does magnesium help leg cramps? 

For older adults, probably not. A 2020 Cochrane review of 11 trials with 735 people found magnesium unlikely to give a meaningful reduction in cramps in older adults. For pregnancy cramps, the evidence was conflicting and of very low certainty. Loose stools were the most common side effect. Ask your provider before starting any supplement.

Does pickle juice stop leg cramps? 

I found no good evidence for night cramps. Houston Methodist sports medicine physician David Braunreiter, MD, says reports are anecdotal and any benefit is likely due to the power of suggestion. His comments were about cramps during exercise, not sleep. Pickle juice is also high in sodium. Our suggestion: ask a provider first if you have high blood pressure, or kidney or heart disease.

Can my medicines cause leg cramps at night? 

Yes, some can. Mayo Clinic lists birth control pills and medicines for blood pressure or cholesterol, and says medicines that increase urine output may raise risk. The AAFP also lists IV iron, estrogens, raloxifene, naproxen and teriparatide. Do not stop a prescription on your own. Tell your prescriber if cramps began after a new medicine.

Sleep better with a plan that adapts

Loosn's 10-question quiz assigns a Movement Profile, and the daily 30-second check-in asks about pain, sleep and energy, so Kai, Loosn's AI physio coach, can adjust your 13-minute sessions as your legs and sleep change. Loosn does not diagnose cramps or their causes, so get checked if you have the warning signs above. See how Loosn works and the whole-body conditions page, then download the app and start your first session.

Dr. Jossy Onwude, MD

Author

References

  1. 1

    Allen RE, Kirby KA.

    Nocturnal leg cramps. American Family Physician, 15 August 2012; 86(4):350-355. A clinician-focused review from the American Academy of Family Physicians

    https://www.aafp.org/afp/2012/0815/p350
  2. 2

    Mayo Clinic Staff.

    Night leg cramps. Symptom page dated 21 February 2026; no individual reviewer named.

    https://www.mayoclinic.org/health/night-leg-cramps/MY00410
  3. 3

    MedlinePlus (National Library of Medicine, NIH).

    Muscle cramps. Health topic page, last updated 15 August 2025; no reviewer named

    https://www.medlineplus.gov/musclecramps.html
  4. 4

    MedlinePlus Medical Encyclopedia.

    Muscle cramps. Reviewed 22 July 2026; updated by Linda J. Vorvick, MD; reviewed by David C. Dugdale, MD, and the A.D.A.M. editorial team

    https://medlineplus.gov/ency/article/003193.htm
  5. 5

    Garrison SR, Korownyk CS, Kolber MR, et al.

    Magnesium for skeletal muscle cramps. Cochrane Database of Systematic Reviews, 2020, Issue 9, CD009402.pub3

    https://cochranelibrary.com/cdsr/doi/10.1002/14651858.CD009402.pub3/pdf/CDSR/CD009402/CD009402_abstract.pdf
  6. 6

    US Food and Drug Administration.

    FDA Drug Safety Communication: new risk management plan and patient Medication Guide for Qualaquin (quinine). 8 July 2010

    https://www.fda.gov/drugs/postmarket-drug-safety-information-patients-and-providers/fda-drug-safety-communication-new-risk-management-plan-and-patient-medication-guide-qualaquin
  7. 7

    Hallegraeff JM, van der Schans CP, de Ruiter R, de Greef MH.

    Stretching before sleep reduces the frequency and severity of nocturnal leg cramps in older adults: a randomised trial. Journal of Physiotherapy, 2012; 58(1):17-22. Dutch trial of 80 adults over 55

    https://research.hanze.nl/en/publications/stretching-before-sleep-reduces-the-frequency-and-severity-of-noc/
  8. 8

    Centers for Disease Control and Prevention (CDC).

    About venous thromboembolism (blood clots). Last reviewed 5 March 2025

    https://www.cdc.gov/blood-clots/about/
  9. 9

    McCallum K.

    Does pickle juice help with muscle cramps? Houston Methodist, 29 November 2022; quotes sports medicine specialist David Braunreiter, MD; no named reviewer; about cramps during exercise

    https://www.houstonmethodist.org/blog/articles/2022/nov/does-pickle-juice-help-with-muscle-cramps/

Share this article


Related Articles

  • A person pushing snow forward with knees bent and the shovel close to the bodyEveryday life

    How to Shovel Snow Without Hurting Your Back (and When to Stop)

    How to shovel snow without hurting your back: push instead of lifting, warm up, pace yourself, know the heart warning signs and when to get help.

    12 min readGolden Simons, DPT
  • A person playing pickle ball with hand injuryMovement

    Pickleball and Padel Injuries: The Common Ones and How to Prevent Them

    The most common pickleball and padel injuries, who is at risk, a warm-up and prevention plan, and when to stop and get checked.

    7 min readJessica Miller, PT, SCS
  • Rider at the bottom of the pedal stroke with a slightly bent kneeMovement

    Back Pain When Cycling: Bike Fit, Position and Strength Fixes

    Why your back hurts on the bike, quick bike-fit checks, neck and hand fixes, an off-bike strength routine and when to get help.

    10 min readJessica Miller, PT, SCS
A woman on the beach stretching one arm across her chest

Ready to move more comfortably?

Download Loosn. Meet Kai. Start a movement program built around you.

Download for iPhone

Join the Android Waitlist

We're working hard to bring Loosn to Android. Drop your email and we'll let you know the moment the Android app is live.