A sudden, rock-hard calf in the middle of the night is one of the most painful ways to wake up. Night leg cramps are very common, especially after 50, and they are rarely a sign of anything serious. Here is why they happen, how to stop one in seconds, and what actually helps prevent them.

Quick answer
- To stop a cramp now: straighten your leg and pull your toes up toward your knee, then stand and walk around.
- To prevent them: stretch your calves for a few minutes before bed every night. It is the simplest habit with the best evidence.
- See a doctor if cramps are frequent, severe, come with swelling, redness or muscle weakness, or started after a new medication.
What are night leg cramps?
Night leg cramps (doctors call them nocturnal leg cramps) are sudden, involuntary and painful tightenings of a muscle, usually the calf, but sometimes the foot or thigh. They last from a few seconds to several minutes, and the muscle can feel sore for a day or more afterwards.
They are different from restless legs syndrome, which causes an urge to move your legs and an uncomfortable crawling feeling, but no hard, painful knot in the muscle.
Why do leg cramps happen at night?
In most people, no single cause is ever found. Researchers think cramps come from muscles and the nerves that control them becoming tired and over-excitable. A few things make them more likely:
- Age: muscles and tendons shorten with age, and cramps become much more common after 50.
- Sleeping position: lying with your feet pointed down (for example under a heavy, tucked-in blanket) keeps the calf in a shortened position.
- Muscle fatigue: an unusually long walk, standing all day, or a hard workout.
- Pregnancy, especially in the second half.
- Some medications, including certain diuretics (“water pills”), statins and some asthma and blood pressure medicines. Never stop a prescribed medicine on your own; ask your doctor instead.
- Health conditions such as diabetes, kidney disease, thyroid problems, nerve problems or poor circulation in the legs.
How to stop a leg cramp fast
- Stretch the muscle. Sit up, straighten your leg and pull your toes up toward your knee. If you can reach, gently pull on your foot.
- Stand and put weight on it. Standing on the cramped leg with your heel on the floor stretches the calf. Walk around for a minute.
- Massage the tight muscle firmly with your hands.
- Use warmth afterwards. A warm towel or shower can ease the soreness once the cramp has passed.
7 ways to prevent night leg cramps
1. Stretch your calves before bed
Stretching is the first thing doctors recommend, and in a small study adults over 55 who did a few minutes of calf and hamstring stretches before sleep had fewer and milder cramps than those who did not.
Try this wall stretch: stand an arm’s length from a wall, step one foot back and keep that heel on the floor. Lean toward the wall until you feel a stretch in the back calf. Hold for 30 seconds, switch legs, and repeat three times on each side.
2. Keep your feet from pointing down while you sleep
Loosen tightly tucked sheets or blankets so your toes are not pushed downward all night. If you sleep on your back, a pillow under your knees can help. If you sleep on your front, let your feet hang over the end of the mattress.
3. Stay active during the day
Regular, moderate activity such as walking or cycling keeps muscles conditioned. Avoid sudden jumps in effort; increase long walks or workouts gradually.
4. Drink enough fluids
There is no strong proof that dehydration causes typical night cramps, but drinking enough during the day is sensible, especially in hot weather, after exercise, or if you take diuretics. Plain water is enough; you do not need sports or electrolyte drinks for everyday cramps.
5. Be realistic about magnesium
Magnesium is often recommended for cramps, but the evidence is disappointing. A review of the research and a randomized trial in adults found that magnesium supplements worked no better than a placebo for typical night leg cramps. Eating magnesium-rich foods (nuts, seeds, beans, whole grains, leafy greens) is good for you anyway, but do not expect a supplement to fix cramps. Magnesium may still play a role in specific situations, such as low magnesium levels shown on a blood test, which your doctor can check.
6. Review your medications with your doctor
If your cramps started or got worse after beginning a new medicine, mention it. A dose change or an alternative may help.
7. Avoid quinine
Quinine was once prescribed for cramps, but health authorities now advise against using it routinely because of rare but serious side effects. Tonic water contains only a tiny amount and has no proven benefit.
When to see a doctor
Most night cramps are harmless. Make an appointment if:
- cramps happen often, disturb your sleep regularly, or keep getting worse
- you also have muscle weakness, numbness or muscle wasting
- cramps started after a new medication
- you have diabetes, kidney, liver or thyroid disease
Get urgent medical help if one leg is swollen, red, warm and painful and the pain does not go away. That can be a sign of a blood clot (deep vein thrombosis), not a cramp.
Frequently asked questions
Are night leg cramps a sign of something serious?
Usually not. In most people, they are linked to age, muscle fatigue or sleeping position. They are worth checking with a doctor when they are frequent, severe, or come with weakness, numbness or swelling.
Does eating bananas stop leg cramps?
Bananas are a healthy source of potassium, but there is no good evidence that eating them prevents typical night cramps.
Can pregnancy cause leg cramps?
Yes, cramps are common in the second half of pregnancy. Gentle calf stretches before bed often help. Talk to your midwife or doctor before taking any supplements.
What is the difference between a cramp and restless legs?
A cramp is a painful, hard tightening of a muscle. Restless legs syndrome is an uncomfortable urge to move the legs, usually in the evening, without the muscle locking up.
This article is for general information and does not replace advice from your doctor. Last reviewed: November 2026.
Sources
- American Family Physician: Nocturnal Leg Cramps
- American Family Physician: Treatments for Nocturnal Leg Cramps
- American Family Physician: Does Magnesium Supplementation Treat Nocturnal Leg Cramps?
- Cochrane review: Magnesium for skeletal muscle cramps
- JAMA Internal Medicine: Magnesium oxide supplementation for nocturnal leg cramps (randomized trial)
