Leg cramps are a common condition that can ruin a good night's sleep. Jane Collins explains why they occur and the steps you can take to stop them happening.
🕒 8 min read
Leg cramps are common, with one UK study suggesting that a third of over-60s experience cramps and 40 per cent report having three or more episodes of leg cramping a week.1
Cramps may not be unusual or life-threatening, but they are unpleasant and painful and can significantly disrupt your sleep. Repeatedly waking during the night can leave you feeling tired and irritable the following day.
In short, sleep is a biological necessity, and we all need enough good-quality sleep to support our health and wellbeing.
If night-time leg cramps are getting in the way of a good night's rest, here's what could be causing them, how to stop leg cramps immediately when they strike, and the steps that may help reduce your risk of getting them again.
What are leg cramps, and what causes them?
A leg cramp is the painful feeling when a muscle – generally in the calves or feet – involuntarily clenches and contracts. These cramps tend to subside within minutes, but they can be deeply intense, shockingly painful and, unsurprisingly, the discomfort is enough to wake you up.2
Experts don't always know exactly what causes cramps at night. According to the NHS, possible causes include ageing, putting too much strain on muscles during exercise, pregnancy, dehydration and certain medicines, including some statins and diuretics.2
Other factors that may contribute to leg cramps include:
Prolonged standing. Research suggests that people who stand for prolonged periods of time at work may be more susceptible to night-time leg cramps.3
Muscle fatigue or strenuous exercise. Putting muscles under greater strain than they are used to can trigger cramping, particularly during or after exercise.
A sedentary lifestyle. Long periods of inactivity may leave muscles feeling stiff, while regular movement and gentle stretching can help maintain mobility.
Ageing. Night-time leg cramps become more common with age, although the precise reason is not always clear.
Certain medicines and health conditions. Some medicines can contribute to cramps, while persistent or unusually severe cramping can sometimes be associated with an underlying health problem.
Low levels of certain nutrients. Significant deficiencies in minerals involved in normal muscle and nerve function can cause muscle symptoms. However, most night-time leg cramps are not necessarily caused by a nutritional deficiency.
How to stop leg cramps immediately
If you're wondering how to stop muscle cramps fast, the first thing to do is gently stretch and massage the affected muscle. Most cramps disappear within a few seconds or minutes, but these steps may help ease the pain while the muscle relaxes.2
If you are woken by a painful leg cramp:
- Stretch it out. If the cramp is in your calf, straighten your leg and gently pull your toes towards you. Standing and putting your weight on the affected leg may also help.
- Massage the muscle. Gently rubbing and massaging the affected area can help the contracted muscle relax.
- Get up and move. If you can do so safely, standing or walking around for a short period can help stretch the affected muscles.
- Apply warmth. A warm towel, hot water bottle or warm shower can feel soothing once the muscle has tightened.
- Treat any lingering soreness. The NHS advises that paracetamol or ibuprofen may help muscle soreness after a cramp, although they will not work quickly enough to treat the cramp itself.2
How to reduce your risk of leg cramps while you sleep
Stay hydrated
Not drinking enough fluid is one possible cause of leg cramps, so make sure you drink regularly throughout the day, particularly during hot weather or around exercise.2
Water is a simple choice, while other drinks and water-rich foods also contribute to your overall fluid intake.
However, avoid drinking excessive amounts too close to bedtime if it causes you to wake frequently to use the toilet, as this could disrupt your sleep in a different way.
Stretch your legs
Regular calf stretching may help reduce how often leg cramps occur. The NHS recommends stretching the calf muscles regularly, including a final set shortly before going to bed.2
Stand facing a wall with your feet flat on the floor, lean forwards with your hands against the wall until you feel your calf stretch, hold briefly and repeat. Stretch gently rather than forcing the muscle.
Check your bedding
If tightly tucked-in bedding forces your feet into a pointed position while you sleep, try keeping the covers looser around your feet. This may feel more comfortable if you regularly experience calf or foot cramps at night.
Wear supportive footwear
Badly fitting shoes or footwear that provides little support can place extra strain on the muscles of your feet and lower legs.
Choose comfortable footwear that supports your feet appropriately for the activity you're doing. If you have persistent foot problems, flat feet or pain when walking, speak to a healthcare professional or podiatrist for individual advice.
If you're looking to support your dietary magnesium intake, a supplement can provide a convenient additional source of magnesium, which contributes to normal muscle function.
Opti-Magnesium®
Highly absorbable magnesium for muscle and bone support
- 375 mg magnesium per daily dose
- Supports normal muscle function, psychological function and the nervous system
- With added vitamin D3 and inulin fibre
What deficiency causes leg cramps at night?
Leg cramps are often blamed on vitamin or mineral deficiencies, but most night-time leg cramps do not have one identifiable nutritional cause. However, severe deficiencies or imbalances involving minerals needed for normal muscle and nerve function can cause muscle symptoms, including cramping.
The nutrients most commonly discussed in relation to muscle function are magnesium, potassium, calcium and sodium. The nutrient functions below reflect authorised Great Britain nutrition and health claims where applicable.5
| Nutrient | Why it matters | Food sources | What to know about cramps |
|---|---|---|---|
| Magnesium | Contributes to normal muscle function, normal functioning of the nervous system and electrolyte balance. | Nuts, seeds, wholegrains, pulses and green leafy vegetables. | Severe magnesium deficiency can cause muscle cramps, but magnesium supplements have not been shown to reliably prevent ordinary night-time cramps in otherwise healthy older adults. |
| Potassium | Contributes to normal muscle function and normal functioning of the nervous system. | Potatoes, bananas, beans, vegetables and some fruits. | Very low potassium can affect muscle function, but routine potassium supplementation is not a treatment for unexplained night-time leg cramps. |
| Calcium | Contributes to normal muscle function and normal neurotransmission. | Dairy foods, fortified alternatives, some green vegetables and fish with edible bones. | Significantly low calcium can cause muscle spasms, but calcium supplements are not routinely recommended for ordinary night cramps unless there is a specific need. |
| Sodium | An important electrolyte involved in fluid balance and nerve and muscle activity. | Salt and many everyday foods. | Large sodium losses can occur through heavy sweating, but most people in the UK already consume enough sodium and should not increase salt intake simply to prevent night cramps. |
What vitamins are good for leg cramps at night?
Although people often search for vitamins for leg cramps at night, the nutrients most closely associated with normal muscle function are actually minerals such as magnesium, potassium and calcium.
There is no specific vitamin supplement proven to prevent ordinary night-time leg cramps in everyone. If your cramps are persistent or you think your diet may be lacking, speak to your GP or another healthcare professional rather than taking high-dose supplements without knowing whether you have a deficiency.
Magnesium – the mineral for muscle health
Magnesium contributes to normal muscle function, electrolyte balance, normal energy-yielding metabolism and normal functioning of the nervous system.5
Food sources of magnesium include nuts and seeds, wholegrains, pulses and dark green leafy vegetables. Some people are more at risk of low magnesium status, including older adults and people with certain gastrointestinal conditions or other health problems that affect absorption.
A severe magnesium deficiency can cause muscle cramps. However, this does not mean that magnesium supplementation will prevent all night-time leg cramps.
A Cochrane review found that magnesium supplementation is unlikely to provide a meaningful reduction in the frequency or severity of idiopathic muscle cramps in older adults. Evidence in pregnancy is less certain and findings have been inconsistent.4
If you are concerned about your magnesium intake, aim to include a range of magnesium-rich foods in your diet. You can also explore the Healthspan Magnesium range if you are looking for a supplement to help support normal muscle function and your overall magnesium intake.
Nocturia: how to stop frequent urination at night
Nocturia can significantly disrupt sleep, with a knock-on effect on quality of life. Fortunately there are ways to help manage the condition.
Read more
Leg cramps FAQs
How do you stop a leg cramp immediately?
Gently stretch and massage the cramped muscle. For a calf cramp, straighten your leg and pull your toes towards you, or stand and carefully put weight through the affected leg. Most cramps ease within a few seconds or minutes.2
How do you stop muscle cramps fast?
Stretching the affected muscle is usually the quickest first step. Massage can also help, and standing or walking briefly may help if you can do so safely. Painkillers are not fast enough to stop a cramp while it is happening, although they may help any soreness afterwards.2
Why do I get leg cramps at night?
Often there is no single identifiable cause. Ageing, strenuous exercise, pregnancy, dehydration and certain medicines can all contribute. If your cramps are frequent, unusually severe or accompanied by other symptoms, speak to your GP.2
What deficiency causes leg cramps at night?
Severe deficiencies in minerals such as magnesium, potassium or calcium can affect muscle function and may cause cramping. However, most ordinary night-time leg cramps are not necessarily a sign of a vitamin or mineral deficiency.
Does magnesium help with leg cramps?
Magnesium is important for normal muscle function, and muscle cramps can occur with severe magnesium deficiency. However, research has not shown magnesium supplements to reliably prevent ordinary night-time cramps in older adults. If you think you may be deficient, discuss this with a healthcare professional.4
Is potassium or magnesium better for leg cramps?
Neither should automatically be taken as a treatment for unexplained night cramps. Both minerals are important for normal muscle function, but supplementation is most appropriate where dietary intake is inadequate or a deficiency has been identified.
How can I prevent leg cramps at night?
Regular calf stretching, particularly before bed, may help reduce the frequency of cramps. Staying adequately hydrated, avoiding sudden increases in strenuous exercise and addressing medicines or health conditions that may be contributing can also help.2
When to be worried about night-time leg cramps
Most leg cramps are harmless and resolve on their own. However, speak to your GP if your cramps are regularly disturbing your sleep, last longer than 10 minutes, or you also have numbness or swelling in your legs.2
You should also seek medical advice if the cramps are becoming significantly worse or more frequent, or if you are concerned that a medicine or underlying health condition could be contributing.
Top ↑





