Home › Stress & Sleep › What causes night cramps, and how can you stop them?
Stress & SleepWhat causes night cramps, and how can you stop them?

What to know
- Night cramps are sudden, involuntary muscle contractions that usually affect the calf, foot or thigh. They are very common and generally harmless, though they can be intensely painful.
- Most night cramps have no clear cause. Known risk factors include ageing, pregnancy, dehydration, certain medications (such as statins and diuretics) and prolonged sitting or standing.
- To relieve a cramp, stretch and massage the affected muscle, then stand and put weight on the leg. The NHS recommends regular calf stretches as the main way to reduce how often cramps happen.
- See your GP if cramps are disrupting your sleep, lasting longer than 10 minutes, or if you also have numbness or swelling in your legs.
If you have ever been woken by a sudden, sharp pain in your calf that leaves the muscle rock-hard and impossible to relax, you have experienced a night cramp. They are one of the most common muscle complaints, affecting up to 60% of adults at some point according to the Cleveland Clinic. Most are harmless and pass within minutes, but when they keep coming back, they can seriously disrupt your sleep and leave you dreading bedtime. Here is what causes them, what to do when one strikes and how to make them less frequent.
What night cramps feel like
A night cramp is a sudden, involuntary tightening of a muscle that happens during sleep or while you are resting. The calf is the most common site, but cramps can also affect the foot, the thigh or, less often, the hamstring. During the cramp, the muscle feels hard and knotted, and the pain can be intense enough to wake you from deep sleep.
Most cramps last from a few seconds to about 10 minutes. Even after the muscle relaxes, it can feel sore and tender for several hours or up to a day afterwards. According to the NHS, most people get leg cramps at night or while resting, and they usually pass without any treatment.
Night cramps are sometimes confused with restless legs syndrome (RLS), but the two are different. RLS causes an uncomfortable urge to move the legs, often described as crawling, tingling or itching, and is usually relieved by movement. It is not normally painful in the way a cramp is. A night cramp, by contrast, is a sharp, forceful contraction that locks the muscle in place.
Why night cramps happen
In many cases, there is no clear cause. The NHS lists ageing, exercise strain, pregnancy and certain medications as common factors, but notes that some cramps simply happen without explanation.
Known risk factors and triggers include:
- Ageing. Night cramps become more common with age, partly because tendons naturally shorten over time and muscles lose mass. The Mayo Clinic lists increasing age as a key risk factor.
- Dehydration. Not drinking enough fluid during the day can affect how muscles function. This is particularly relevant in warm weather or after exercise.
- Muscle fatigue and inactivity. Both overworking muscles (through intense exercise or long periods of standing) and underusing them (through prolonged sitting or bed rest) can increase the risk of cramps.
- Pregnancy. Night cramps are common in the later stages of pregnancy. The NHS lists pregnancy among the recognised causes.
- Medications. Several types of medication can contribute to cramps. The NHS specifically mentions statins (used to lower cholesterol) and diuretics (used for blood pressure). The Cleveland Clinic adds gabapentin, certain antidepressants and some inhalers to the list.
- Underlying health conditions. In some cases, frequent cramps can be associated with conditions such as peripheral artery disease, diabetes, kidney disease, thyroid disorders or peripheral neuropathy. However, these conditions usually come with other symptoms as well.
One common belief is that night cramps are caused by a lack of minerals such as magnesium or potassium. While severe deficiencies can cause muscle problems, the evidence that mineral supplements prevent cramps in people who are otherwise healthy is weak. The Samitivej Hospital medical team describes the mineral-deficiency theory as a common misconception in many cases.
What to do when a cramp strikes
The priority during a cramp is to release the contraction. The NHS recommends:
- Stretch the muscle. For a calf cramp, straighten your leg and pull your toes firmly towards your shin. Hold the stretch until the cramp eases.
- Massage the muscle. Use your hands to knead the tight area firmly but gently.
- Stand up and put weight on the leg. Pressing your foot flat into the floor can help the muscle relax.
- Walk around. Once the worst of the pain has passed, walking for a minute or two can help ease the remaining tightness.
After the cramp has passed, the muscle may still feel sore. The NHS suggests that paracetamol or ibuprofen can help with the lingering soreness, but notes that painkillers do not work during the cramp itself because they take too long to act. Applying a warm flannel or a hot water bottle to the area can also help relax the muscle.
If night cramps are a regular problem, keep a few things by the bed: a glass of water, a small towel you can loop around your foot to pull it into a stretch, and a hot water bottle or heat pad. Being able to act quickly can shorten the cramp and help you get back to sleep.
How to reduce night cramps
There is no guaranteed way to prevent night cramps entirely, but several measures can make them less frequent.
Stretch regularly
The NHS recommends a daily calf-stretching routine as the main way to reduce cramps. The technique is simple: stand facing a wall with your arms outstretched and your hands flat against it. Keeping your feet flat on the floor, lean forward until you feel a stretch in your calves. Hold for two to three seconds, then stand upright. Repeat for about five minutes, three times a day, with the last session just before bed. Once cramps become less frequent, you can reduce this to once or twice a day.
Stay hydrated
Drinking enough water throughout the day helps maintain normal muscle function. The NHS and the Cleveland Clinic both recommend staying well hydrated and limiting alcohol and caffeine, which can contribute to dehydration.
Keep active
Gentle activity such as walking or riding a stationary bike for a few minutes before bed can help prepare the muscles for rest. Banner Health recommends light exercise after dinner as a way to reduce cramp frequency.
Keep bedding loose
Tight sheets and heavy blankets can press the feet downward during sleep, shortening the calf muscles and making cramps more likely. Keeping the bedding loose at the foot of the bed allows your feet to move freely.
Check your footwear
Shoes that lack proper arch support can put extra strain on the muscles and tendons in the lower leg. If you spend long periods standing, supportive footwear may help reduce the strain that contributes to cramps.

Natural and traditional remedies
Several natural approaches are commonly suggested for night cramps, though the evidence for most is limited.
- Magnesium supplements. Magnesium is involved in muscle contraction and relaxation. Some studies have looked at whether magnesium supplements can reduce leg cramps, particularly in pregnancy, but the results are mixed. A Cochrane review of magnesium for leg cramps (Garrison et al., 2012, updated 2020) found that magnesium is unlikely to provide meaningful benefit for most people with leg cramps, though there may be a small benefit in pregnancy. If you suspect you are low in magnesium, speak to your GP before supplementing.
- Tonic water (quinine). Tonic water contains small amounts of quinine, which has historically been used for cramps. However, the amount in tonic water is very low and unlikely to have a therapeutic effect. Prescription quinine is available in the UK and the NHS notes that a GP may prescribe quinine tablets if stretching alone does not help, but it is not suitable for everyone and carries a risk of side effects.
- Epsom salt baths. Soaking in a warm bath with Epsom salts (magnesium sulphate) is a popular home remedy. The warm water itself helps relax muscles, but there is no strong evidence that magnesium is absorbed through the skin in meaningful amounts.
None of these is a substitute for the core approach recommended by the NHS: regular stretching, staying hydrated and staying active.
When to see your GP
Most night cramps are a nuisance rather than a sign of something serious. However, the NHS advises seeing your GP if:
- Cramps are disrupting your sleep on a regular basis.
- You also have numbness or swelling in your legs.
- Cramps are lasting longer than 10 minutes despite stretching.
Seek urgent medical attention if a cramp lasts longer than 10 minutes and does not respond to stretching, if you develop muscle weakness or wasting alongside the cramps, or if cramps start after you have been exposed to a toxic substance (such as pesticides, heavy metals or industrial chemicals). The Mayo Clinic also advises seeking prompt care if cramps are accompanied by significant leg swelling, skin changes or severe pain that does not ease.
Your GP can review your medications, check for underlying conditions and, if needed, prescribe treatment. In the UK, quinine tablets are the main prescription option for persistent night cramps. The NHS notes that quinine is not suitable for everyone, and your GP will discuss the risks and benefits with you before prescribing it.
Common questions
Why do I get cramps in my calves at night?
The calf is the most common site for night cramps, partly because the calf muscle is under constant use during the day and can become fatigued, and partly because sleeping positions can keep the muscle in a shortened state. Pointing the feet downward in bed, which happens naturally for many people, shortens the calf and makes it more prone to cramping. Keeping the bedding loose and doing calf stretches before bed may help.
Are night cramps a sign of something serious?
In most cases, no. Night cramps are extremely common, especially as you get older, and are usually harmless. However, if they are very frequent, unusually severe or accompanied by other symptoms such as numbness, swelling, muscle weakness or skin changes, it is worth seeing your GP to rule out underlying conditions such as peripheral artery disease, kidney disease or peripheral neuropathy.
Does magnesium help with leg cramps?
The evidence is mixed. A Cochrane review found that magnesium supplements are unlikely to provide meaningful benefit for most adults with leg cramps, though there may be a small benefit during pregnancy. If you think you may be deficient in magnesium, speak to your GP rather than self-supplementing, as they can check your levels and advise you.
Can dehydration cause night cramps?
Dehydration is listed as a possible risk factor for leg cramps by both the NHS and the Mayo Clinic. When the body is low on fluids, the balance of electrolytes that muscles need to contract and relax properly can be disrupted. Staying well hydrated throughout the day, particularly in warm weather or after exercise, may help reduce the risk.
What is the best sleeping position to prevent leg cramps?
There is no single best position, but avoiding positions that point the toes downward can help. If you sleep on your back, try propping the toes up with a pillow or keeping the bedding loose so the feet are not pushed flat. Some people find that sleeping on their side with a pillow between the knees helps keep the muscles relaxed.