The short answer: leg cramps at night are common, usually harmless, and often have no clear cause. To stop one, pull your toes toward your shin or stand on that leg, then massage the muscle. See a doctor if cramps disturb your sleep or last longer than 10 minutes. Get urgent help for throbbing pain and swelling in one leg, which can be a blood clot.
You’re fast asleep, and then your calf locks. You grab at it in the dark, not sure whether to stand up or stay still. It passes, but the muscle aches, and now you’re wide awake wondering why this keeps happening.
You’re in good company. A review in American Family Physician says 50–60% of adults report night cramps.
How to stop a leg cramp right now
The NHS says a cramp can last from a few seconds to 10 minutes. These steps, from the NHS and Cleveland Clinic, can help it pass:
- Stretch it. Straighten your leg and pull your toes toward your shin. A towel around your foot helps if you can’t reach.
- Stand on it. Put your weight on that leg and press your foot into the floor. Hold a chair if you need to.
- Massage it. Rub the tight muscle with your hands.
- Walk it off. A few steps and some leg wiggling can ease it.
- Try heat or cold. Use a warm bath or heating pad, or an ice pack wrapped in a towel.
For a thigh cramp, Cleveland Clinic suggests pulling your foot toward your buttock. The muscle may stay sore for up to 24 hours, the NHS says. Paracetamol or ibuprofen can ease that soreness, but they work too slowly to help during the cramp.
Why it happens at night
Often, nobody can say. Both the NHS and American Family Physician note that many cramps have no known cause, and researchers still don’t fully understand the mechanism. The most common links:
- Getting older. Cleveland Clinic says risk rises with age, partly because tendons naturally shorten over time.
- Muscle strain. Hard exercise can set them off, the NHS says, especially in hot or humid weather.
- Long periods of sitting, or standing and working on concrete floors.
- Dehydration from not drinking enough.
- Pregnancy, especially the later stages.
- Health conditions, such as blood flow problems, nerve damage from diabetes, or liver or kidney disease.
After a broken night, dinner shouldn’t be another job
A free week of easy meals
Seven days of breakfasts, lunches and dinners, most ready in 30 minutes, with one grocery list for the week.
Do bananas, potassium or magnesium help?
This is the advice everyone repeats, so here’s the honest answer: the evidence is weak.
Bananas and potassium. American Family Physician says night cramps have no proven link to low electrolytes such as potassium, and it does not support potassium as a treatment. We found no trial testing bananas for night cramps. MedlinePlus does suggest potassium-rich foods such as oranges and bananas, but as part of avoiding cramps around exercise. Cleveland Clinic does list low blood potassium as a possible cause, but that’s for your doctor to test, not something to guess at. A banana is a good food. Just don’t expect it to stop cramps. If you want more potassium for other reasons, see our guide to foods high in potassium. People with kidney disease, or who take certain blood pressure medicines, should check with their doctor before eating much more of it.
Magnesium. A 2020 Cochrane review found it’s unlikely to give older adults a meaningful reduction in cramps. Some experts still recommend it, Cleveland Clinic notes, and the picture in pregnancy is less clear. Ask your doctor before you buy a supplement.
Prescription medicine. American Family Physician concludes that no treatment has been proven both safe and effective. The NHS says a GP may consider quinine if stretching fails, but it carries real risks and isn’t suitable for everyone. The US FDA has warned that those risks outweigh its modest benefit, so advice differs by country.
What may make cramps less frequent
Stretch your calves. This is the NHS’s main advice. Stand facing a wall with your hands on it and your feet flat. Lean forward until you feel the stretch, hold for 2–3 seconds, then stand up. Repeat for about 5 minutes, three times a day, with the last session just before bed.
Be realistic here. The NHS says stretches can reduce cramps but may not stop them, and one trial cited in American Family Physician found no effect from calf stretching. It’s still low risk, so it’s worth trying for a few weeks.
Cleveland Clinic also suggests these simple changes:
- Move before bed. A short walk or easy bike ride may help.
- Change how your feet rest. On your back, use pillows to keep your toes pointing up. On your front, let your feet hang off the end of the bed.
- Drink enough water, and limit alcohol and caffeine.
- Wear shoes that fit and support your feet.
If your legs also feel stiff when you wake, read why you feel stiff in the morning.
Could your medicines play a part?
Possibly. The NHS names statins and diuretics. Cleveland Clinic adds others, including some inhalers, estrogens and pain medicines. The evidence varies, and American Family Physician says reviews have not actually implicated diuretics. Either way, don’t stop a prescription on your own. Tell your doctor when the cramps started, and ask if there’s an alternative.
Is it a cramp or something else?
| What you notice | It may be | What to do |
|---|---|---|
| Sudden, hard, painful knot that eases within minutes | A leg cramp | Stretch and massage |
| A crawling feeling and an urge to move, eased by moving | Restless legs syndrome | Mention it to your doctor |
| Aching when you walk that eases with rest | Claudication, a blood flow problem | See your doctor |
| Throbbing pain and swelling in one leg, perhaps with red or darkened skin | A blood clot (DVT) | Get urgent help |
When to see a doctor
See your doctor if:
- Cramps are disturbing your sleep
- You also have numbness in your legs, or swelling in both legs. For swelling in one leg, see the blood clot advice below
- Cramps are very painful, frequent or keep coming back
- You notice skin changes, or weakness in your legs
A cramp that lasts longer than 10 minutes needs attention. The NHS says to see a GP. Cleveland Clinic goes further and says to go to the emergency room, as you should for a cramp you can’t bear. If in doubt, get seen.
Get urgent help if you think you have a blood clot. The NHS warning signs are throbbing pain in one leg, usually the calf or thigh, swelling, and red, blue or darkened skin around the painful area. Call emergency services if you have those signs and also feel short of breath or have chest pain.
Your next step
Tonight, try the wall stretch before bed, and tuck a pillow under your feet so your toes stay up. If cramps keep waking you, start a simple note of when they happen, and take it to your doctor.
Poor sleep can leave you drained. If that sounds familiar, read why you might always feel tired.
For the mornings after a bad night
The Banana Book
A 7-day banana habit plan plus 60 simple recipes, including five-minute, no-oven ideas for low-energy days. It’s a cookbook, not a cramp treatment. Only $4.99.
Quick questions
What is the fastest way to stop a leg cramp at night?
Straighten your leg and pull your toes toward your shin, or stand and press your foot into the floor. Then massage the muscle. Painkillers act too slowly to help during the cramp itself, the NHS says.
Do bananas help leg cramps?
There’s no good evidence that they do. A review in American Family Physician found no proven link between night cramps and low potassium, and did not support potassium as a treatment. Bananas are a fine food, but don’t count on them to stop cramps.
Does magnesium help leg cramps?
Probably not for most adults. A 2020 Cochrane review concluded that magnesium is unlikely to give older adults a meaningful reduction in cramps. Some experts still suggest it, so ask your doctor before taking a supplement.
Why do I get leg cramps every night?
Often no clear cause is found. Possible links include muscle strain, long periods of sitting, dehydration, pregnancy and certain medicines. If cramps are disturbing your sleep, the NHS says to see a GP.
Are leg cramps a sign of a blood clot?
A cramp comes on suddenly and eases within minutes. A clot, known as DVT, usually causes throbbing pain and swelling in one leg, and the skin may change color. If you think you have a clot, get urgent medical help. If you also have chest pain or feel short of breath, call emergency services.
This article is general information, not medical advice. If you’re worried about your legs, please talk to your doctor.
Sources
- NHS. Leg cramps. Reviewed December 2023.
- NHS. Deep vein thrombosis (DVT).
- Cleveland Clinic. Leg Cramps at Night and How to Prevent Leg Cramps and Treat Them at Home.
- Allen RE, Kirby KA. Nocturnal Leg Cramps. American Family Physician. 2012.
- Cochrane. Magnesium for skeletal muscle cramps. 2020.
- MedlinePlus. Muscle cramps.