Black and white photo of a person holding their calf with both hands, with the calf muscle shaded red

Keto and Leg Cramps: Causes, Stretches and When to See a GP

Quick answer

Does keto cause leg cramps? The NHS and NICE don't list keto, low-carb or any other diet as a cause. The NHS says leg cramps are common, usually harmless and only last a short time, and can sometimes be caused by ageing, straining muscles during exercise, pregnancy, some medicines, not drinking enough fluids and liver disease from drinking too much alcohol. The reason for some cramps is unknown.

At a glance

  • Up to 10 minuteshow long a leg cramp can last (NHS)
  • 24 hourshow long the muscle might feel sore afterwards (NHS)
  • 3 times a daythe NHS calf stretch, for 5 minutes each time
  • 20–50g carbsa day on a ketogenic diet (BDA)
On this page
  1. Does keto cause leg cramps?
  2. What a leg cramp feels like
  3. Causes of leg cramps: NHS and NICE
  4. Fluids, salt and minerals on keto
  5. During a cramp: what the NHS suggests
  6. Calf stretches and night-time tips
  7. When to see a GP about leg cramps
  8. Our Keto Electrolytes: what's in a scoop
  9. FAQs
  10. Sources

Does keto cause leg cramps, and what can you do when one starts? This guide sets out what the NHS and NICE Clinical Knowledge Summaries (CKS), NICE's guidance for GPs and other primary care staff, say about the causes of leg cramps, what to do during one, the calf stretch the NHS describes, and when to see a GP. We also cover fluids and minerals on a keto diet, and what's in our Keto Electrolytes, with figures from the labels.

Does keto cause leg cramps?

Neither the NHS nor NICE CKS lists keto, low-carb or any other diet among the causes of leg cramps. A ketogenic diet limits carbohydrate, usually to 20–50g a day according to the British Dietetic Association (BDA), and the UK guidance we checked doesn't link it to cramps.

NICE CKS says most night-time leg cramps are thought to be idiopathic, which means they have no known cause. The NHS list does include straining muscles during exercise and not drinking enough fluids, which are worth thinking about whatever you eat. If you're not sure why you're getting cramps, the NHS says a GP will examine you to try to find out the reason.

What a leg cramp feels like

The NHS says leg cramps happen when a muscle in the leg tightens and causes a sudden pain that can make it hard to move. They can happen at any time, but most people have them at night or when resting. According to the NHS:

  • cramps can last from a few seconds to 10 minutes
  • they usually affect the calf muscle, below the knee at the back of the leg
  • less often, they affect the muscles in the feet or the thighs
  • after a cramp has stopped, the muscle might feel sore for up to 24 hours

NICE CKS adds that night-time leg cramps are common, and that they become more common as people get older.

Causes of leg cramps: NHS and NICE

The NHS gives a short list of things that can sometimes cause leg cramps. NICE CKS gives a longer list of conditions and medicines that cramps "may be associated with". Neither list includes a diet.

Possible causes, and who lists them
Possible cause Listed by
Ageing NHS
Straining muscles during exercise, which can be worse in hot or humid weather NHS (NICE CKS: strenuous exercise)
Pregnancy, usually in the later stage NHS, NICE CKS
Some medicines, such as statins (for cholesterol) and diuretics (for blood pressure) NHS, NICE CKS
Not drinking enough fluids (dehydration) NHS
Liver disease, including from drinking too much alcohol NHS, NICE CKS
Electrolyte imbalance: high or low potassium, or low sodium, calcium or magnesium, in the blood NICE CKS
Vitamin B or D deficiency NICE CKS
Some conditions of the nerves, circulation, kidneys or thyroid, diabetes and Addison's disease NICE CKS

From the NHS leg cramps page (reviewed 1 December 2023) and NICE CKS Leg cramps: causes (revised December 2022). The NHS says the reason for some cramps is unknown.

NICE CKS says a history and examination can help a GP rule out other causes, and that tests aren't usually needed unless the cramp has unusual features or an underlying cause is suspected. If you think a medicine you take might be linked to your cramps, speak to your GP or pharmacist before you stop or change it.

Fluids, salt and minerals on keto

The NHS lists not drinking enough fluids among the causes of leg cramps. The government's Eatwell Guide recommends 6 to 8 cups or glasses of fluid a day, and the NHS says you may need more if you're pregnant or breastfeeding, in a hot environment, physically active for long periods, or ill. It suggests drinking enough so your pee is a clear pale yellow colour. Water, tea and coffee all count, the NHS says.

NICE CKS lists electrolyte imbalance, such as low potassium, sodium or magnesium in the blood, among the conditions cramps may be associated with. The NHS doesn't give different daily amounts for keto diets:

Adults aged 19 to 64 (NHS)
Mineral Daily amount From supplements
Potassium 3,500mg 3,700mg or less is unlikely to have obvious harmful effects
Magnesium 300mg (men), 270mg (women) 400mg or less is unlikely to cause any harm
Salt No more than 6g (2.4g sodium) –

Potassium and magnesium from the NHS vitamins and minerals page, which gives the Department of Health and Social Care advice on supplements. The salt limit is for everyone aged 11 and over, from NHS Salt in your diet; sodium worked out as salt ÷ 2.5.

The Department of Health and Social Care says you should be able to get all the potassium and magnesium you need from a varied and balanced diet. The NHS says older people should not take potassium supplements unless advised to by a doctor, because their kidneys may be less able to remove potassium from the blood. It also says taking more than 400mg of magnesium for a short time can cause diarrhoea.

NICE CKS doesn't recommend any supplement for leg cramps. It says a 2020 Cochrane review concluded there was no benefit to magnesium supplementation, and that there isn't strong evidence to support other treatments it lists.

For the potassium and magnesium figures in keto foods, see our guides to potassium on keto and magnesium on keto. For salt, see how much sodium to have on keto, and for all four minerals together, our keto electrolytes guide.

During a cramp: what the NHS suggests

The NHS says most cramps go away without you doing anything. It also says:

  • Stretch and massage: stretching and massaging the muscle may ease the pain during a cramp.
  • Stand on it: standing up and putting your weight on the leg with the cramp may also help.
  • Painkillers afterwards: paracetamol or ibuprofen can help ease muscle soreness after a cramp, but won't help while it's happening, as they take too long to work.

For a calf cramp, NICE CKS gives the example of straightening the leg and pulling your foot up towards your shin (dorsiflexing the ankle). It says cramps with no known cause settle on their own within a few minutes.

Calf stretches and night-time tips

The NHS says regular calf-stretching exercises may help to reduce cramps, but may not stop them completely. This is the stretch it describes:

  1. Stand facing a wall and stretch out your arms until your hands can just touch it.
  2. Make sure you can stand up straight with your feet flat on the floor.
  3. Lean forward, pressing your hands against the wall, until you feel your calf muscles stretch. Hold for 2 or 3 seconds.
  4. Stand up straight again.
  5. Repeat a few times for 5 minutes, 3 times a day, with the last time just before bed.

If the number of cramps goes down, the NHS says you might only need to do the exercise once or twice a day.

What NICE CKS says about the evidence

NICE CKS lists stretching the affected muscles three times a day as traditional advice, along with stopping your toes pointing downwards in bed: propping your feet up on a pillow if you lie on your back, or hanging them over the end of the bed if you lie on your front, and keeping blankets loose. It says there's no definite evidence that these measures work.

When to see a GP about leg cramps

The NHS says to see a GP if:

  • leg cramps are disturbing your sleep
  • you also have numbness or swelling in your legs
  • cramps last longer than 10 minutes

A GP will examine you to try to find out the reason for your leg cramps, and suggest a treatment depending on the cause, the NHS says. This might be stretching exercises, or quinine tablets if exercise hasn't helped. Quinine isn't suitable for everyone, and the GP will discuss the possible risks and side effects with you.

NICE CKS also advises going back to your GP if how often your cramps happen, how severe they are or what they feel like changes, or if they affect your quality of life. It says people with severe cramps and other worrying symptoms, such as not passing any urine, confusion or drowsiness, or a very high or low temperature, should be admitted to hospital, so get urgent medical help.

Our Keto Electrolytes: what's in a scoop

Our Keto Electrolytes Powder is a flavoured drink powder sold as a food supplement, in three flavours: lemon, forest fruits and passionfruit papaya. It isn't a treatment for leg cramps, and the NHS and NICE CKS don't suggest electrolyte drinks for them. This is what one 5g scoop contains, according to the labels:

Per 5g scoop, from the labels
Nutrient Per scoop % NRV or RI
Potassium 504mg 25%
Magnesium 50.4mg (passion­fruit 50mg) 13%
Vitamin C 20mg 25%
Sodium 0.40g –
Salt 1.02g 17%
Carbohydrate 0.15g (passion­fruit 0.1g) –

From the tub labels shown on our product pages, checked 30 October 2026 and again on 1 November 2026. Percentages use the nutrient reference values (NRVs) and the 6g salt reference intake (RI) in Annex XIII of retained Regulation (EU) No 1169/2011. The labels show potassium, magnesium and vitamin C as % RDA (25.2%, 13.4% and 25%) and give no salt percentage.

The labels say to dissolve one scoop (5g) or two (10g) in 500ml to 1 litre of cold liquid, not to exceed the recommended daily intake, and that food supplements should not be used as a substitute for a varied diet. Two scoops give 2.04g of salt, about a third of the NHS limit of 6g a day.

Our Keto Electrolytes contain salt and potassium. If you have kidney or heart problems or high blood pressure, take any medicines, or are pregnant, ask your GP or pharmacist before you use them.

Free delivery on orders over £30.

Groovy Keto Electrolytes Powder, lemon flavour, tub

Keto Electrolytes, lemon

250g tub, 50 scoops

View product
Groovy Keto Electrolytes Powder, forest fruits flavour, tub

Keto Electrolytes, forest fruits

250g tub, 50 scoops

View product
Groovy Keto Electrolytes Powder, passionfruit papaya flavour, tub

Keto Electrolytes, passionfruit papaya

250g tub, 50 scoops

View product
Check with your GP first

Speak to your GP, diabetes nurse or a registered dietitian before you make big changes to your diet. This is especially important if you have diabetes and take insulin or other medicines that can cause hypos, or take SGLT2 inhibitors, as your medication may need to change. The same goes if you're pregnant, breastfeeding or have a history of eating disorders.

Key takeaways

  • Keto isn't on the lists. The NHS and NICE CKS don't list keto or any other diet among the causes of leg cramps.
  • Most cramps are harmless. The NHS says they're common, usually harmless and last from a few seconds to 10 minutes.
  • Stretch and massage. That's what the NHS suggests during a cramp, with a calf stretch 3 times a day.
  • See a GP if cramps disturb your sleep, last longer than 10 minutes, or come with numbness or swelling in your legs.

Frequently asked questions

Does keto cause leg cramps?

The NHS and NICE don't list keto or any other diet among the causes of leg cramps. The NHS says they can sometimes be caused by ageing, straining muscles during exercise, pregnancy, some medicines, not drinking enough fluids or liver disease from alcohol, and that the reason for some cramps is unknown.

Why do I get leg cramps at night?

The NHS says leg cramps can happen at any time, but most people have them at night or when resting. NICE CKS says night-time leg cramps are common, become more common as people get older, and are mostly thought to have no known cause. The NHS says to see a GP if cramps are disturbing your sleep.

How do you stop a leg cramp?

The NHS says most cramps go away without you doing anything. Stretching and massaging the muscle may ease the pain, and standing up and putting your weight on the leg may also help. Paracetamol or ibuprofen can ease soreness afterwards, but won't help during a cramp, as they take too long to work.

When should you see a GP about leg cramps?

The NHS says to see a GP if leg cramps are disturbing your sleep, you also have numbness or swelling in your legs, or cramps last longer than 10 minutes. A GP will examine you to try to find out the reason, and suggest a treatment depending on the cause, such as stretching exercises.

Are electrolyte drinks recommended for leg cramps?

The NHS and NICE CKS don't suggest electrolyte drinks for leg cramps, and NICE CKS says a 2020 Cochrane review concluded there was no benefit to magnesium supplementation. According to the labels, one 5g scoop of our Keto Electrolytes has 504mg of potassium, about 50mg of magnesium and 1.02g of salt.

Sources

Back to blog
1 of 4