Why Do My Legs Cramp at Night? Causes, Quick Relief and Prevention
By WellnessVigor · Updated October 15, 2026 · 7 min read
This article contains affiliate links. If you buy through them, we may earn a small commission at no extra cost to you. Learn more.
A sudden, painful knot in your calf that jolts you awake is a nocturnal leg cramp. Up to 60% of adults say they’ve had them, and they become more common with age and in pregnancy.
Here’s what causes night leg cramps, how to stop one quickly, how to prevent them and when they might signal something that needs a doctor.
Quick answer
Night leg cramps are sudden, painful tightening of the calf or foot muscles. According to a review in American Family Physician, they’re probably caused by muscle fatigue and nerve dysfunction rather than electrolyte problems, and are more common with age, pregnancy, certain medical conditions and some medications. Stretch the calf by pulling your toes toward you to relieve a cramp. Regular calf stretching, staying active and staying hydrated may help prevent them. A Cochrane review found magnesium is unlikely to prevent typical cramps in older adults.
Table of Contents
ToggleWhat causes night leg cramps?
- Muscle fatigue and nerve misfiring: the most likely explanation, according to the review.
- Age: cramps become more common as we get older.
- Sitting or standing for long periods, or overdoing exercise.
- Pregnancy.
- Medical conditions: vascular disease, lumbar spinal stenosis, liver cirrhosis, kidney dialysis and others.
- Medications: some are strongly associated with cramps, including certain osteoporosis drugs, estrogen therapy and diuretics. Don’t stop any medication without talking to your doctor.
Nocturnal leg cramps are different from restless legs syndrome, which causes an urge to move the legs rather than a painful knot.
How to stop a cramp fast
- Stretch the calf: straighten your leg and pull your toes toward your shin, or stand and press your heel into the floor.
- Walk around or stand on the cramping leg.
- Massage the muscle firmly.
- Apply heat afterward to ease soreness.
How to prevent night leg cramps
- Stretch your calves for a few minutes before bed. See bedtime stretches.
- Stay active during the day; break up long sitting.
- Drink enough water through the day.
- Keep bedding loose around your feet so your toes aren’t pointed downward all night.
- Wear supportive shoes during the day.
- Review medications with your doctor if cramps started after a new drug.
Want a simple, step-by-step plan to sleep better? The 14-Day Sleep Reset guide walks you through fixing your schedule, evening routine and bedroom, one day at a time.
Low-dose 3 mg melatonin gummies
A gentler dose for occasional sleepless nights, jet lag or getting back on schedule after the weekend.
Good to know: Avoid in pregnancy and check with your doctor if you take blood thinners, diabetes or epilepsy medicines.
Does magnesium help leg cramps?
It’s a popular remedy, but the evidence is weak. A 2020 Cochrane review of 11 trials concluded that magnesium is unlikely to provide clinically meaningful cramp prevention for older adults with typical (idiopathic) cramps; evidence for pregnancy-related cramps was conflicting. If you take magnesium for other reasons, see magnesium glycinate for sleep.
When to see a doctor
- Cramps that are frequent, severe or disrupt your sleep regularly.
- Cramps with leg swelling, redness, warmth or skin changes.
- Muscle weakness or numbness.
- Cramps that started after a new medication.
Products that may help
These are common, inexpensive options that some people find helpful. We have not personally tested these products. Links go to Amazon search results so you can compare current options and prices.
BEST FOR CALF STRETCHING
Slant Board
Standing on a slant board for a minute or two is an easy way to stretch your calves daily.
Pros
- Easy daily stretch
- Adjustable angles
- Durable
Cons
- Takes space
- Start gently
BEST FOR QUICK RELIEF
Foam Roller
Rolling the calves can ease tightness.
Pros
- Cheap
- Durable
- Easy
Cons
- Uncomfortable at first
- Bulky
BEST FOR SOOTHING HEAT
Microwavable Heating Pad
Warmth can ease soreness after a cramp.
Pros
- No cords
- Reusable
- Comfortable
Cons
- Heat fades
- Avoid overheating
BEST FOR STRETCHING
Stretching Strap
A strap with loops makes calf and hamstring stretches easy in bed or on the floor.
Pros
- Cheap
- Portable
- Guided loops
Cons
- Not essential
- Learning curve
Keep reading
Frequently asked questions
Are night leg cramps caused by dehydration?
Dehydration may contribute for some people, but research suggests muscle fatigue and nerve activity are more important.
Do bananas help leg cramps?
There’s little evidence that potassium-rich foods prevent typical night cramps.
Why are leg cramps worse at night?
Lying still with feet pointed downward shortens the calf muscles, and muscle fatigue from the day may contribute.
Can leg cramps be serious?
Usually not, but frequent cramps can be linked to medical conditions or medications. See a doctor if you’re concerned.
Does quinine help leg cramps?
Quinine is not recommended for routine leg cramps because of the risk of serious side effects.
Sources
This article is for general information only and is not medical advice. See our Medical Disclaimer.