February 20, 2025

6 minutes read

What Causes Leg Cramps and How to Get Rid of Them

Leg cramps are a sudden, painful tightening of a leg muscle, most often the calf, and they usually pass within a few seconds to 10 minutes. Common causes include muscle strain from exercise, dehydration, older age, late pregnancy and some medicines, but often there is no clear cause. To get rid of a leg cramp, stretch and massage the muscle until it relaxes.

This guide explains what causes leg cramps, what helps in the moment, what may lower your chances of getting them and when to see a doctor. It is general information, not medical advice. If you have a health condition, are pregnant or take regular medication, check with your doctor or pharmacist before you change anything.

What are leg cramps?

A leg cramp is an involuntary muscle contraction. Involuntary means you are not choosing to tighten the muscle. It locks up on its own, and it can be hard to move your leg until it lets go.

Cramps usually affect the calf, but they can also hit the feet or thighs. According to the NHS, they happen most often at night or when you are resting. The muscle can feel sore for up to 24 hours afterward.

What causes leg cramps?

Some leg cramps happen for no obvious reason. Others are linked to something else, such as exercise, pregnancy, a medicine or liver disease, as nidirect explains.

The NHS lists these common causes and triggers:

  • Getting older.
  • Strain on your muscles during exercise, especially in hot or humid weather.
  • The later stages of pregnancy.
  • Some medicines, including statins (for cholesterol) and diuretics (often used for high blood pressure).
  • Dehydration.
  • Liver disease caused by heavy drinking.

Mayo Clinic adds holding one position for a long time, poor physical conditioning, heavy sweating and being overweight. Less often, cramps are linked to narrowed leg arteries or pressure on the nerves in your spine.

Low levels of minerals such as potassium, calcium or magnesium can also play a part. So can conditions such as diabetes, or problems with the nerves, liver or thyroid.

Cramps during exercise

Cramps that start during or just after a workout are called exercise-associated muscle cramps. Many people blame dehydration or low salt. The research points more strongly to muscle fatigue.

In a study of 210 Ironman triathletes, the athletes who cramped had similar blood electrolyte levels and similar body-weight changes to those who did not. Electrolytes are minerals in your blood, such as sodium and potassium, that help your nerves and muscles work. The factors that predicted cramping were faster race times and a history of cramping in recent races.

A 2016 review describes these cramps as a problem of tired nerves and muscles. As a muscle fatigues, the signals telling it to contract can outweigh the signals telling it to relax. This may explain why cramps often show up late in a hard session, or when you push harder or longer than usual.

Fluids still matter. Heavy sweating is a listed risk factor, and staying hydrated supports your health and performance. Drinking more is just unlikely to be the whole answer for exercise cramps.

Cramps at night

Night-time leg cramps are also called nocturnal leg cramps. They become more common as you get older. nidirect notes that three in four cases happen at night, and they can wake you up and leave your calf sore the next day.

How to get rid of a leg cramp right now

Most cramps ease within a few minutes. These steps can help the muscle relax:

  1. Stretch the muscle. For a calf cramp, straighten your leg and pull your toes up toward your knee. Loop a towel around your foot if you can’t reach.
  2. Stand on it. The NHS suggests standing up and putting your weight on the affected leg.
  3. Massage the muscle. Rub it firmly but gently until it starts to loosen.
  4. Stretch a thigh cramp gently. For the back of the thigh (hamstrings), straighten the leg and lean forward slightly from your hips. For the front of the thigh (quadriceps), hold something for balance and bring your heel toward your bottom.

The 2016 review names stretching as the most effective way to relieve an exercise cramp that is already happening. If the muscle is sore afterward, the NHS says paracetamol or ibuprofen can help. They do not work fast enough to stop a cramp in progress. Ask a pharmacist if you are not sure they are right for you.

How to lower your chances of leg cramps

No single method stops every leg cramp. These steps are simple, low-risk and may help.

Stretch your calves regularly

The NHS says regular calf stretches may reduce cramps, though they may not stop them completely. It suggests this routine:

  1. Stand facing a wall with your arms straight out and your hands touching it.
  2. Keep your feet flat and your body straight.
  3. Lean forward, pressing your hands into the wall, until you feel your calves stretch. Hold for 2 to 3 seconds.
  4. Stand back up and repeat for about 5 minutes.

The NHS suggests doing this 3 times a day, with the last session just before bed. If your cramps become less frequent, once or twice a day may be enough. For more ideas, see these post-workout stretches for strength training.

Stay hydrated

Mayo Clinic advises drinking fluids through the day and during activity, then afterward. Choose drinks without caffeine or alcohol. If you are not sure how much you need, read our guide to how much water to drink each day.

Help your legs at bedtime

If you get night cramps, Mayo Clinic suggests light exercise before bed, such as a few minutes on a stationary bike. nidirect also suggests keeping your bedding loose. If you sleep on your back, keep your toes pointing up. If you sleep on your front, let your feet hang over the end of the bed.

Build fitness gradually and warm up

Because fatigue seems to drive many exercise cramps, the 2016 review suggests focusing on delaying fatigue. In practice, that means building up your training step by step, rather than jumping into long or hard sessions you are not ready for.

Start each session with a proper warm-up. Our guides cover how to warm up before strength training and warm-up exercises to do before a run. Mayo Clinic lists poor physical conditioning as a risk factor, so getting fitter and stronger over time is a sensible step. Exercises such as the machine standing calf raise build strength in your lower legs.

Pace yourself in races and long sessions too. In the triathlon study, faster race times were linked to more cramping.

Do magnesium, electrolytes or vitamin K2 help?

Magnesium

Magnesium is often sold as a cramp remedy. A 2020 Cochrane review found that for older adults with cramps that have no clear cause, magnesium probably makes little or no difference to how often they happen. For cramps in pregnancy, the evidence is too weak to say either way.

Electrolyte drinks

Electrolyte drinks can help you replace fluid and salt during long, sweaty sessions. But in the triathlon study, blood electrolyte levels were similar in athletes who did and did not cramp. So these drinks are unlikely to be a reliable fix for exercise cramps on their own.

Vitamin K2

A 2024 randomized clinical trial tested vitamin K2 for night cramps. In this kind of trial, people are assigned by chance to the real supplement or a placebo (a dummy pill). It included 199 adults aged 65 and over in China.

People who took 180 micrograms of vitamin K2 (menaquinone-7) each day for 8 weeks went from about 2.6 cramps a week to about 1. The placebo group went from about 2.7 to 3.6 cramps a week.

This is a promising result, but it comes from one trial in one group of older adults. A summary in American Family Physician notes that vitamin K2 may reduce the effect of warfarin, a blood-thinning medicine, so people taking warfarin should not use it. Speak to your doctor or pharmacist before trying any supplement.

Prescription medicine

If stretching has not helped, the NHS says a GP may discuss quinine tablets. Quinine is not suitable for everyone, and your doctor will explain the risks and side effects.

When to see a doctor about leg cramps

Most leg cramps are harmless. See a doctor (your GP in the UK) if:

  • cramps disturb your sleep or affect your daily life.
  • they happen often.
  • a cramp lasts longer than 10 minutes.
  • you also have numbness, swelling, redness or skin changes in your leg.
  • you notice muscle weakness.
  • the pain is severe, or cramps do not improve with self-care.
  • you think a medicine may be causing them (do not stop a prescribed medicine without advice).

These points come from the NHS, Mayo Clinic and nidirect. nidirect also advises getting medical advice right away if a cramp lasts more than 10 minutes and does not ease with exercise. The same applies if cramps follow contact with something toxic or infectious, such as a wound contaminated with soil.

Keep training your legs

For a balanced lower-body session to build from, try these five leg exercises for strength and muscle. If you want each session set out for you, 12REPS builds your plan around your goal, your equipment and the time you have. Every exercise comes with a trainer demonstration, and the app remembers what you lifted, so you can progress one small step at a time.

Sources

Share this article

12Reps Team

The 12reps app is your ultimate fitness companion, crafting tailored workout plans, tracking your progress, and keeping you motivated every step of the way. Whether you’re at home, in the gym, or on the go, our adaptable approach fits seamlessly into your lifestyle — providing the support and guidance you need to crush your goals and stay on track.

Disclaimer: The ideas in this blog post are not medical advice. They shouldn’t be used for diagnosing, treating, or preventing any health problems. Always check with your doctor before changing your diet, sleep habits, daily activities, or exercise.  JUST12REP.COM  isn’t responsible for any injuries or harm from the suggestions, opinions, or tips in this article.

12reps- best strength training
[instagram-feed feed=1]

Stay in the loop with 12reps

We know how important it is to stay motivated and informed on your fitness journey. That’s why our newsletter is packed with everything you need to succeed:
By submitting your information, you agree to subscribe to the 12reps mailing list in order to receive my free PDF guides plus fitness video tutorials, nutrition plans and tips and exclusive offers.