Quick answer: night leg cramps are sudden, painful tightenings of the calf or foot muscles, and they are common: the Sleep Foundation says about 60% of people get them. The cause is often unclear, but tired muscles, some medicines, pregnancy and low fluid intake are all recognised contributors. Gentle calf stretching is the best-supported prevention, and the evidence for magnesium is weaker than most pages suggest.
Quick Fix / Summary
- Stretch your calves gently before bed, and keep it up: the Sleep Foundation reports that a pre-bed stretching routine helps after about six weeks
- During a cramp, stretch and massage the muscle, or stand on the affected leg (NHS advice)
- Check your medicines with a doctor or pharmacist, because statins and diuretics are known to trigger cramps
- Do not rely on magnesium: a Cochrane review found it unlikely to help older adults, and the evidence in pregnancy is conflicting
- Keep fluids steady through the day and go easy on alcohol in the evening
- See a doctor if cramps are frequent, last more than 10 minutes, or come with swelling or numbness
- A sharp, hard knot in your calf or foot wakes you up, and it eases within minutes
- Your leg stays sore for hours or a day afterwards
- You are older, pregnant, or take medicines such as statins or diuretics, and want to know whether they could be involved
- You have been told to take magnesium and want to know whether it is worth it
- You want to know whether this is a cramp or restless legs, and when it needs a doctor
- Stand an arm’s length from a wall, step one foot back, keep that heel on the floor and lean forward until you feel a stretch in the calf
- Do both legs, gently, and stop if anything hurts sharply
- Make it a nightly habit rather than something you do after a bad night
- Buying magnesium first: stretching has better support and costs nothing
- Stretching only after cramps happen: the Sleep Foundation figure of about six weeks assumes a regular routine
- Stopping a prescribed medicine yourself: raise it with the prescriber instead
- Treating all night leg discomfort as a cramp: an urge to move, rather than a painful knot, points to restless legs
- Ignoring swelling or numbness: these change the picture and are worth a check
- Cramps are frequent or keep waking you
- A cramp lasts more than 10 minutes
- Your legs are swollen, numb or tingling
- Cramps began after starting a new medicine
Who This Is For
Leg Cramp or Restless Legs? How to Tell
The two are easy to mix up at 3am. The Sleep Foundation describes a nocturnal leg cramp as intense, sharp pain that usually lasts less than 10 minutes, with the muscle visibly tight. Restless legs syndrome is different: it is an urge to move your legs rather than a sudden painful contraction. Our guide to restless legs syndrome covers that condition in full.
| Night leg cramp | Restless legs | |
|---|---|---|
| What it feels like | Sudden, intense pain; the muscle is hard and tight | An urge to move the legs, often with an uncomfortable crawling or aching feeling |
| How long it lasts | Usually under 10 minutes, with soreness that can linger | Can last as long as you stay still |
| What eases it | Stretching or massaging the muscle, standing on the leg | Moving around |
What Causes Leg Cramps at Night
Honest answer first: in many people no single cause is found. The NHS says leg cramps are linked to ageing, straining the muscles with a lot of exercise, pregnancy, certain medicines, not drinking enough fluids, and liver disease from heavy alcohol use. The Sleep Foundation adds prolonged standing and overexercised muscles to that list. Here is what each one means in practice.
1. Tired or overworked muscles
A long day on your feet or an unusually hard workout can leave calf muscles more cramp-prone that night. Both the NHS and the Sleep Foundation list this. If it fits your pattern, the stretching routine below is the first thing to try.
2. Medicines that can trigger cramps
The NHS names statins (cholesterol medicines) and diuretics (water tablets used for high blood pressure) as medicines that can cause leg cramps. The Sleep Foundation also lists steroids and some antidepressants. If your cramps started after a new prescription, tell your doctor or pharmacist. Do not stop a prescribed medicine on your own; there is often an alternative, and that decision belongs with the person who prescribed it.
3. Pregnancy
Leg cramps are common in pregnancy, usually in the later stages, according to the NHS. If this is you, our guide to sleep during pregnancy covers positioning and other night-time changes, and your midwife or doctor can advise on cramps specifically.
4. Not enough fluid
The NHS lists not drinking enough fluids as a contributor. We did not find strong trial evidence that drinking extra water prevents cramps, so treat this as sensible background habit rather than a proven fix. Steady intake through the day is the aim; see how dehydration affects sleep for how to time fluids without adding bathroom trips.
5. Alcohol
The Sleep Foundation lists alcohol as a possible contributor, and the NHS links liver disease from heavy drinking with cramps. Cutting back in the evening is a low-risk step if you suspect it, and it helps sleep anyway. For the wider picture, see how alcohol affects sleep quality.
6. An underlying health condition
Frequent cramps that do not respond to lifestyle changes can occasionally point to something else. The Sleep Foundation lists cardiovascular disease, kidney disease, nerve damage and circulation problems as possible underlying causes. This is why persistent cramps are worth mentioning to a doctor rather than putting up with.
What Helps
Stretch your calves, regularly
This is the best-supported option. The NHS says regular calf-stretching exercises may help reduce cramps and suggests doing them before bed. The Sleep Foundation reports that a stretching routine before bed helped reduce cramps and leg pain after about six weeks, so give it time before judging it.
When a cramp hits
The NHS suggests stretching and massaging the muscle, and standing on the affected leg. Many people also find that pulling the toes up towards the shin, or walking around once the cramp eases, helps.
Check the medicine list
If you take a statin, a diuretic or another regular medicine, ask a doctor or pharmacist whether it could be involved. Bring up when the cramps began relative to any change in medication.
Keep fluids steady and trim the evening alcohol
Spread drinks through the day instead of catching up late, and see how a few alcohol-free evenings affect things. Neither is proven to prevent cramps, but both are low-risk.
What about quinine?
The NHS says a GP may prescribe quinine tablets if exercises have not helped, but also that quinine is not suitable for everyone and the GP will discuss risks and side effects. It is a prescription decision, not a self-treatment.
Does Magnesium Help Leg Cramps?
Probably not much, and certainly less than the many pages recommending it imply. The Cochrane review pooled 11 trials of magnesium for muscle cramps. For older adults, five trials (271 people) led the authors to conclude that magnesium is unlikely to provide clinically meaningful cramp prevention, and the certainty of that evidence was rated moderate. For cramps in pregnancy, five trials (408 women) gave conflicting results with important limitations, so the review could not say whether it helps. Mild side effects, mostly digestive such as diarrhoea, were more common with magnesium than with placebo. Source: the Cochrane review of magnesium for muscle cramps.
None of this means magnesium is harmful for everyone, and some people feel it helps. But if you are going to try it, speak to a doctor or pharmacist first, especially if you are pregnant, have kidney problems or take other medicines. If you want to understand the sleep side of it, our guide to magnesium for sleep covers the forms and the cautions, and it does not claim magnesium treats cramps.
Common Mistakes to Avoid
When to See a Doctor
Occasional cramps are usually harmless. The NHS advises seeing a GP if cramps disturb your sleep, come with numbness or swelling, or last longer than 10 minutes. The Sleep Foundation adds that frequent cramps that do not respond to lifestyle changes are worth a medical review, because they can reflect an underlying condition.
FAQ
Why do I get leg cramps at night?
Often the cause is unclear. The NHS links leg cramps to ageing, straining the muscles through exercise, pregnancy, certain medicines such as statins and diuretics, not drinking enough fluids, and liver disease from heavy alcohol use. The Sleep Foundation adds prolonged standing.
How do I stop a leg cramp quickly?
The NHS suggests stretching and massaging the muscle and standing on the affected leg. Many people also find that pulling the toes towards the shin, or walking around once it eases, helps.
Does magnesium stop leg cramps?
Probably not for older adults. A Cochrane review concluded that magnesium is unlikely to provide clinically meaningful cramp prevention in this group, and the evidence in pregnancy is conflicting. Digestive side effects such as diarrhoea were more common than with placebo.
Can stretching prevent night leg cramps?
It is the best-supported option. The NHS says regular calf stretching may help, and the Sleep Foundation reports that a routine before bed reduced cramps and leg pain after about six weeks.
Are night leg cramps the same as restless legs syndrome?
No. A cramp is a sudden, painful tightening that usually lasts under 10 minutes. Restless legs syndrome is an urge to move the legs, usually eased by moving around.
Can medicines cause leg cramps at night?
Yes. The NHS names statins and diuretics, and the Sleep Foundation also lists steroids and some antidepressants. Talk to your doctor or pharmacist before changing anything.
When should I see a doctor about leg cramps?
See a doctor if cramps disturb your sleep, last more than 10 minutes, or come with swelling or numbness, as the NHS advises. Frequent cramps that do not improve with lifestyle changes are also worth checking.
Key Takeaways
Night leg cramps are common and often have no single identifiable cause. Regular calf stretching before bed is the best-supported prevention, and it may take around six weeks to show. Review medicines such as statins and diuretics with a professional, keep fluids steady and trim evening alcohol. Magnesium has weak evidence for cramps, so do not expect it to be the fix. See a doctor if cramps are frequent, last more than 10 minutes, or come with swelling or numbness.
About this article
Written by the Sleep Fixes editorial team. We’re not medical professionals. We research each topic against primary sources and hold ourselves to being critical and thorough about what actually makes it onto the site.
This article is part of Sleep Fixes, a site focused on practical, easy-to-follow solutions for common sleep problems like night waking, dry mouth, overheating, and disrupted sleep.
It is not medical advice. If your symptoms are severe, persistent, or worsening, consider consulting a qualified healthcare professional.
