Muscle Cramps: Causes, Night Cramps, Dehydration and What Helps

Muscle Cramps: Causes, Night Cramps, Dehydration and What Helps

Symptoms & Everyday Health 15 min read

Muscle cramps are sudden, painful tightening episodes in a muscle. They can happen during exercise, while resting, during illness, after sweating heavily, or in the middle of the night when you are trying to sleep.

Most muscle cramps are short-lived and not serious. A calf cramp at night can feel intense, but it often settles within minutes. However, cramps can become frustrating if they keep happening, disturb sleep, affect walking, or appear alongside other symptoms such as weakness, swelling, numbness, severe pain or signs of dehydration.

This guide explains what muscle cramps are, why they happen, what causes night cramps, how dehydration and mineral balance may play a role, what helps during a cramp, how to reduce repeat cramps, and when to speak to a pharmacist, GP or urgent care service.

Quick answer: Muscle cramps are sudden involuntary muscle contractions, often affecting the calf, foot, thigh or hands. Common triggers include muscle fatigue, exercise, dehydration, pregnancy, some medicines, ageing, long periods sitting or standing, and some medical conditions. Stretching the affected muscle usually helps during a cramp. Recurrent, severe or unexplained cramps should be discussed with a healthcare professional.

What is a muscle cramp?

A muscle cramp happens when a muscle suddenly tightens and cannot relax properly. It may feel like a hard knot, spasm or gripping pain. The muscle can feel firm to touch, and the pain may last from a few seconds to several minutes.

Cramps most commonly affect the legs, especially the calf muscles. They can also affect the feet, thighs, hands, arms, abdomen or muscles around the ribs. Some people only get occasional cramps after exercise. Others have repeated night cramps that interrupt sleep.

The NHS describes leg cramps as a common and usually harmless condition where the muscles in the leg suddenly become tight and painful. The cramps often happen in the calf, but can also affect the feet or thighs. NHS leg cramps guidance.

What do muscle cramps feel like?

People describe muscle cramps in different ways. Some feel like a sudden pulling sensation. Others feel like the muscle has locked, twisted or turned into a hard ball.

Common features include:

  • sudden sharp pain
  • a tight or hard muscle
  • a visible muscle twitch or knot
  • difficulty moving the affected limb during the cramp
  • soreness afterwards
  • sleep disturbance if cramps happen at night

After a severe cramp, the muscle may feel tender for several hours or even a day. This can be normal, but pain that is severe, persistent, swollen or linked with injury should be assessed.

Why do muscle cramps happen?

Muscle cramps can happen for many reasons. Often, no single cause is found. They may be linked to how the muscle and nerves behave, especially when a muscle is tired, shortened, dehydrated or irritated.

Common causes and triggers include:

  • muscle fatigue after exercise
  • not stretching regularly
  • sudden increase in activity
  • dehydration
  • heavy sweating
  • low salt or electrolyte levels in some situations
  • long periods standing or sitting
  • sleeping with the foot pointed down
  • pregnancy
  • ageing
  • some medicines
  • circulation problems
  • nerve irritation
  • thyroid, kidney, liver or diabetes-related problems in some cases

Most cramps are benign, but repeated cramps can sometimes be a clue that another issue needs checking.

Night cramps: why do cramps happen in bed?

Night cramps are very common, especially in the calf or foot. They can wake you suddenly with intense pain and may leave the muscle sore the next day.

Night cramps may happen because the calf muscle is in a shortened position while sleeping. If your toes point down under the duvet, the calf is slightly shortened, and this may make cramp more likely in some people.

Other possible night cramp triggers include:

  • muscle fatigue from activity earlier in the day
  • standing for long periods
  • dehydration or sweating
  • pregnancy
  • age-related muscle and nerve changes
  • some medicines, including certain diuretics
  • reduced circulation or nerve irritation

Night cramps are different from restless legs syndrome. Restless legs usually causes an unpleasant urge to move the legs, often relieved by movement. A cramp is a painful muscle contraction that feels tight, hard and sudden.

Muscle cramps and dehydration

Dehydration can contribute to cramps in some people, especially after heat exposure, illness, vomiting, diarrhoea, fever, alcohol intake, intense exercise or heavy sweating. When the body loses fluid and salts, muscles and nerves may become more irritable.

Symptoms of dehydration in adults and children can include thirst, headache, dizziness, dark yellow strong-smelling urine, peeing less often, tiredness and dry mouth, lips or tongue. The NHS also highlights that babies may show signs such as fewer wet nappies and unusual sleepiness. NHS dehydration guidance.

Dehydration-related cramps may be more likely if cramps happen during hot weather, after exercise, during a stomach bug, after not drinking much, or alongside dark urine and dizziness.

For more detail, read our guide to dehydration symptoms in adults and children. If cramps happen with fever, body aches or cold/flu symptoms, you may also find flu-like symptoms: cold, flu, COVID or something else? useful.

Electrolytes, magnesium and potassium: do they matter?

Electrolytes are minerals such as sodium, potassium, calcium and magnesium. They help nerves and muscles work properly. In some situations, low or disrupted electrolyte levels may contribute to muscle cramps.

This is more likely when there has been:

  • heavy sweating
  • vomiting or diarrhoea
  • dehydration
  • very restrictive dieting
  • use of water tablets or diuretics
  • kidney disease
  • some hormone or metabolic conditions

However, many people with ordinary night cramps do not have a clear mineral deficiency. Taking supplements “just in case” does not always help and may cause side effects or interact with medicines.

Magnesium is often marketed for cramps, but evidence is mixed for typical night leg cramps. It may be more relevant in pregnancy or confirmed deficiency, but it is not a guaranteed solution. If you are considering magnesium, potassium or electrolyte supplements and you have kidney disease, heart disease, take blood pressure medicines, take diuretics, or are pregnant, speak to a pharmacist or GP first.

Muscle cramps after exercise

Exercise-related cramps often happen when a muscle is tired, overloaded or working harder than usual. They may happen during activity or afterwards, especially if you have increased intensity quickly, trained in heat, skipped warm-up, or not recovered well.

Common situations include:

  • running longer than usual
  • hill walking or climbing stairs
  • football, cycling or gym sessions
  • returning to exercise after a break
  • working out in hot weather
  • not drinking enough during long activity

What helps is often simple: build up gradually, warm up, stretch after exercise, drink enough, replace fluids after heavy sweating, and allow recovery days. If cramps are severe, repeated or linked with weakness, dark urine or severe muscle pain after exercise, seek medical advice.

For related guidance, see sports injuries: causes, treatment and recovery.

Muscle cramps during hot weather

Hot weather can make cramps more likely because you lose fluid and salts through sweat. Heat-related cramps can happen during work, sport, gardening, travel or long periods outdoors.

Heat cramps may be an early sign that your body is under strain. They can also appear alongside heat exhaustion symptoms such as heavy sweating, weakness, dizziness, headache, nausea and intense thirst.

If cramps happen in the heat:

  • stop activity
  • move to a cooler place
  • drink fluids
  • cool the body
  • stretch the affected muscle gently
  • avoid returning to intense activity too soon

Read our guide to heat exhaustion and heatstroke if cramps happen with heat illness symptoms.

Medicines that may contribute to cramps

Some medicines can increase the chance of cramps, either by affecting fluid balance, salts, nerves or muscles. This does not mean you should stop prescribed medicine by yourself. It means cramps are worth mentioning to a pharmacist or GP if they started after a new medicine or dose change.

Medicines sometimes linked with cramps include:

  • diuretics, also called water tablets
  • some asthma medicines
  • some blood pressure medicines
  • statins in some people, especially if muscle pain or weakness is present
  • some osteoporosis medicines
  • some antidepressants or antipsychotics
  • some hormone treatments

If you take statins and have muscle pain, cramps or weakness that is new or severe, see our guide to statins: benefits and side effects, and speak to your GP or pharmacist.

Medical conditions linked with cramps

Most cramps are not caused by a serious condition. However, repeated or unusual cramps may sometimes be linked with underlying health problems.

Possible medical links include:

  • diabetes and nerve changes
  • thyroid problems
  • kidney disease
  • liver disease
  • peripheral artery disease or circulation problems
  • spinal nerve irritation
  • pregnancy
  • anaemia or nutritional deficiency in some cases
  • neurological conditions, rarely

If cramps are happening with fatigue, weight change, numbness, weakness, cold feet, leg pain when walking, abnormal blood tests or other symptoms, it is worth asking your GP whether further checks are needed.

Related guides include thyroid blood test results, kidney blood test results, HbA1c and blood sugar results, iron, ferritin and anaemia and fatigue: why am I always tired?.

What helps during a muscle cramp?

When a cramp starts, the aim is to lengthen and relax the affected muscle.

For a calf cramp:

  • straighten the leg
  • pull your toes gently upwards towards your shin
  • stand and put weight through the affected leg if safe
  • massage the calf gently
  • walk slowly once the worst pain eases

For a foot cramp:

  • gently pull the toes upwards
  • stand carefully and press the foot flat
  • massage the arch of the foot
  • try gentle ankle circles once it eases

For a thigh cramp:

  • gently stretch the front or back of the thigh depending on where the cramp is
  • avoid forcing the movement
  • massage the area
  • use warmth after the cramp if the muscle remains tight

The NHS advises stretching and massaging the muscle during a leg cramp, and stretching calf muscles regularly if cramps keep happening. NHS leg cramp advice.

Should you use heat or cold?

Warmth may help relax a tight muscle after a cramp. A warm towel, warm bath or heat pack can feel soothing. Cold may help if the muscle is sore afterwards, especially after exercise, but avoid applying ice directly to the skin.

Use whatever feels better, but do not use heat or cold if you have reduced sensation, poor circulation, fragile skin or diabetes-related foot problems without advice.

How to reduce night cramps

There is no guaranteed way to prevent every night cramp, but regular stretching and simple sleep-position changes may help.

Helpful steps include:

  • stretch your calves before bed
  • avoid sleeping with toes strongly pointed down
  • keep bedding loose around the feet
  • stay hydrated during the day
  • avoid sudden intense evening exercise if it triggers cramps
  • wear supportive footwear during the day
  • review medicines with a pharmacist if cramps started recently

A simple calf stretch: stand facing a wall, place one foot behind the other, keep the back heel on the floor, and lean forward until you feel a stretch in the calf. Hold gently for around 20 to 30 seconds. Repeat a few times on each side.

Hydration: what should you drink?

For most people, regular fluids through the day are enough. Water is usually fine. If you have been sweating heavily, exercising for a long time, vomiting, having diarrhoea, or working in heat, you may need to replace salts as well as water.

Options may include:

  • water
  • milk
  • oral rehydration solution from a pharmacy after diarrhoea or vomiting
  • foods containing fluid, such as soups, fruit and yoghurt
  • electrolyte drinks during prolonged heavy sweating, if appropriate

Be cautious with high-sugar sports drinks, excessive caffeine and alcohol. Alcohol can worsen dehydration and may make night cramps more likely in some people.

Do bananas help muscle cramps?

Bananas contain potassium, which is important for muscle and nerve function. Eating bananas as part of a balanced diet is fine, but they are not a guaranteed cramp treatment.

If your cramps are caused by muscle fatigue, nerve irritation, medicines, pregnancy, poor circulation or sleeping position, a banana alone is unlikely to solve the problem.

A balanced diet with enough fluids, regular movement and stretching is usually more useful than relying on one food.

Should you take magnesium for cramps?

Magnesium supplements are widely promoted for cramps, but they do not help everyone. They may be useful if you have a confirmed deficiency or in some pregnancy-related cramps under professional advice. For typical night cramps, the benefit is uncertain.

Magnesium can cause diarrhoea and may not be suitable for people with kidney disease or those taking certain medicines. Speak to a pharmacist or GP before taking it regularly, especially if you have long-term conditions or take prescribed medication.

What about quinine?

Quinine used to be commonly prescribed for night cramps, but it is now used much more cautiously because it can cause serious side effects in some people. NICE Clinical Knowledge Summaries says quinine is generally not recommended for idiopathic leg cramps because of the poor benefit-to-risk ratio, although a trial may be considered in selected people with severe, frequent cramps when other measures have not worked. NICE CKS leg cramps management.

Do not take quinine tablets unless prescribed. Do not try to self-treat cramps with tonic water; the amount of quinine is different and it is not a reliable treatment.

When should you see a pharmacist?

A pharmacist can help if cramps are mild but troublesome, especially if you want advice about hydration, stretching, medicines or supplements.

See a pharmacist if:

  • you have occasional leg cramps and want self-care advice
  • you are unsure whether a medicine could be contributing
  • you are considering magnesium or electrolyte supplements
  • you recently had vomiting or diarrhoea and may be dehydrated
  • you want advice on oral rehydration solutions

For more on everyday pharmacy support, read when to see a pharmacist instead of a GP.

When should you see a GP?

Most muscle cramps do not need a GP appointment, but you should seek medical advice if cramps are frequent, severe, unexplained or linked with other symptoms.

See a GP if:

  • cramps keep happening and disturb sleep regularly
  • self-care and stretching have not helped
  • cramps started after a new medicine
  • you have muscle weakness
  • you have numbness, tingling or burning pain
  • you have swelling, redness or warmth in one leg
  • you have leg pain when walking that eases with rest
  • you have diabetes and foot or leg symptoms
  • you have kidney, liver or thyroid disease
  • you are pregnant and cramps are severe or worrying
  • you have unexplained weight loss, fever or severe fatigue

Your GP may review medicines, examine circulation and nerves, and consider blood tests such as kidney function, thyroid function, calcium, magnesium, liver function, blood sugar, full blood count or iron levels depending on your symptoms.

When is a cramp urgent?

A cramp itself is rarely an emergency. But symptoms that look like a cramp may sometimes be something else, such as a blood clot, severe dehydration, infection, circulation problem or serious muscle injury.

Seek urgent medical advice if you have:

  • one calf that is swollen, red, hot or very tender
  • shortness of breath or chest pain with leg swelling
  • severe dehydration symptoms, confusion or fainting
  • dark brown urine after intense exercise
  • severe muscle pain and weakness after exertion
  • new severe back pain with leg weakness or numbness
  • loss of bladder or bowel control with back or leg symptoms
  • severe pain after injury
  • fever with a painful, swollen limb

Call 999 if you have chest pain, severe breathlessness, collapse, stroke symptoms, severe confusion, or symptoms that feel like a medical emergency.

Can cramps be confused with other conditions?

Yes. Several conditions can feel similar to cramp but need different assessment or treatment.

  • Restless legs syndrome: an urge to move the legs, often worse at rest and relieved by movement.
  • Peripheral artery disease: cramping leg pain during walking that improves with rest.
  • Sciatica: nerve pain from the back into the leg, often with tingling or numbness.
  • Deep vein thrombosis: one-sided calf swelling, pain, warmth or redness.
  • Muscle strain: pain after injury or overstretching, often sore with movement.
  • Neuropathy: burning, tingling, numbness or electric pain rather than a tight muscle knot.

If the pattern does not feel like a typical short cramp, or if symptoms are one-sided, persistent or worsening, seek advice.

Final thoughts

Muscle cramps are common and usually harmless, especially when they happen occasionally in the calf or foot. They can be triggered by muscle fatigue, exercise, dehydration, hot weather, pregnancy, ageing, medicines or simply sleeping with muscles in a shortened position.

The most useful immediate step is usually gentle stretching of the affected muscle. For prevention, regular calf stretching, hydration, gradual exercise, loose bedding around the feet and medicine review can help. Supplements are not always necessary, and quinine should only be used if prescribed after a careful discussion of risks and benefits.

Speak to a healthcare professional if cramps are frequent, severe, new, unexplained, linked with weakness or numbness, or associated with swelling, redness, dehydration, fever or circulation symptoms.

For official advice, see the NHS guide to leg cramps, NHS guidance on dehydration, and NICE CKS guidance on leg cramp management.

This article is for general information only and should not replace medical advice. If cramps are severe, persistent, unusual or linked with worrying symptoms, speak to a pharmacist, GP, NHS 111 or emergency services as appropriate.

Frequently asked questions

What causes muscle cramps?

Common causes include muscle fatigue, exercise, dehydration, heavy sweating, pregnancy, ageing, long periods sitting or standing, some medicines and, less commonly, medical conditions affecting nerves, circulation, kidneys, thyroid or blood sugar.

Why do I get cramps at night?

Night cramps may happen because the calf muscle is shortened while sleeping, especially if the toes point down. They can also be linked with muscle fatigue, dehydration, pregnancy, ageing, medicines or circulation and nerve issues.

How do I stop a calf cramp quickly?

Straighten the leg and gently pull your toes upwards towards your shin. Massage the calf and stand carefully if safe. The cramp usually eases within minutes.

Can dehydration cause muscle cramps?

Yes, dehydration can contribute to cramps in some people, especially after sweating, hot weather, vomiting, diarrhoea, fever or not drinking enough. Dark urine, dizziness, thirst and dry mouth may suggest dehydration.

Do bananas stop cramps?

Bananas contain potassium and can be part of a healthy diet, but they are not a guaranteed cramp treatment. Many cramps are not caused by low potassium.

Does magnesium help muscle cramps?

Magnesium may help some people with deficiency or certain pregnancy-related cramps, but it does not help everyone. Speak to a pharmacist or GP before taking it regularly, especially if you have kidney disease or take regular medicines.

Should I drink electrolyte drinks for cramps?

Electrolyte drinks may help after heavy sweating, vomiting or diarrhoea, but they are not needed for everyone. For ordinary day-to-day cramps, regular fluids and a balanced diet are usually enough.

Can statins cause cramps?

Some people taking statins report muscle pain, cramps or weakness. Do not stop statins without medical advice, but speak to your GP or pharmacist if symptoms are new, severe or persistent.

Are night cramps a sign of poor circulation?

Usually not, but circulation problems can cause leg pain or cramping, especially during walking that eases with rest. If you have cold feet, leg pain when walking, ulcers, colour change or risk factors such as smoking or diabetes, see a GP.

When should I worry about leg cramps?

Seek advice if cramps are frequent, severe, worsening, linked with weakness, numbness, swelling, redness, heat, dehydration, fever, dark urine after exercise, or one-sided calf swelling and pain.

Can pregnancy cause cramps?

Yes, leg cramps are common in pregnancy, especially later pregnancy. Gentle stretching and hydration may help. Speak to a midwife or GP if cramps are severe, one leg is swollen or painful, or you are worried.

Is quinine safe for cramps?

Quinine is not routinely recommended because it can cause serious side effects. It may be considered only in selected severe cases after other measures have failed and after a GP has discussed risks and benefits.

Can cramps happen with flu or viral illness?

Yes. Viral illnesses can cause muscle aches, fever, sweating and dehydration, which may make cramps more likely. Seek advice if you are very unwell, dehydrated, confused, breathless or symptoms are worsening.

Can diabetes cause cramps?

Diabetes can be linked with cramps through dehydration, circulation problems, kidney issues or nerve damage. People with diabetes should seek advice if cramps are frequent, associated with numbness, foot problems or leg pain when walking.

What tests might a GP do for repeated cramps?

Depending on symptoms, a GP may consider blood tests for kidney function, thyroid function, calcium, magnesium, liver function, blood sugar, full blood count or iron levels, and may examine circulation, nerves and medicines.

Related Articles

One sponsor per category

Become a category sponsor on All Health and Care

Reach people searching for UK GPs, dentists and care homes through relevant sponsor placements, homepage visibility and sponsored healthcare articles.

GP & Primary Care

GP Sponsorship

Appear across GP articles, NHS GP practice pages, location pages, private clinic discovery and homepage sponsor sections.

Package

£500/month · billed monthly

Includes 2 sponsored articles per month.

Dental

Dental Sponsorship

Reach visitors viewing dental articles, NHS dentist listings, location dentist pages and private dental clinic profiles.

Package

£500/month · billed monthly

Includes 2 sponsored articles per month.

Care Homes

Care Home Sponsorship

Be visible across care home articles, NHS care home listings, location pages and private care home discovery.

Package

£500/month · billed monthly

Includes 2 sponsored articles per month.

Exclusive category placement Homepage sponsor section 2 sponsored articles/month Up to 3 backlinks per article
Become a sponsor