Leg Cramps at Night: Causes and What Helps

Leg Cramps at Night: Causes and What Helps

Updated 2 November 2026

Night leg cramps are sudden, painful tightenings of the calf or foot that can wake you in the middle of the night. This guide covers what triggers them, how to stop one fast, and the nightly routine that can help keep them away, including stretching and magnesium.

Quick answer: Night leg cramps are usually triggered by long hours on your feet, hard exercise, some medicines, pregnancy or simply getting older. To stop one, flex your foot toward your shin and stand on the leg. To prevent them, stretch your calves every night before bed and consider magnesium: in a 60-day trial, adults taking magnesium at bedtime had a bigger drop in cramps than those on placebo, and in a pregnancy trial most women taking magnesium bisglycinate cut their cramps by at least half. Give it about two months and keep a simple cramp log to see how it works for you.

What a night leg cramp is

A night leg cramp is a sudden, involuntary tightening of a muscle, usually in the calf, that often wakes people from sleep. Cramps can last from a few seconds to about 10 minutes, and the muscle can stay sore for up to a day afterwards.4 They are common and usually harmless, but frequent cramps break up your sleep and leave you tired the next day, which is why a good night-time routine matters.

Why night cramps happen

Often there is no single cause.5 When there is one, it is usually one of these.

Trigger What it often looks like What to do
Long periods standing or sitting, or a long journey Cramps after a long shift, flight or drive Move regularly and stretch the calves
Exercise, especially a sudden jump in intensity Cramps during a session, or at night after a hard one Build training load gradually and stretch after exercise
Some medicines, such as diuretics (water tablets) Cramps that start after a new prescription Ask your doctor; do not stop a prescription on your own
Pregnancy, usually in the later months Calf cramps, often at night Stretch nightly and talk to your midwife or doctor
Ageing Cramps that become more frequent over the years Daily stretching and regular activity
Low minerals, such as magnesium or potassium Cramps along with tiredness or twitching Eat magnesium-rich foods and consider a supplement

Magnesium plays a part in how muscles contract and relax, and many people do not get enough of it from food. If you are wondering whether you are running low, read symptoms of magnesium deficiency and how to spot them.

How to stop a cramp fast

  • Flex the foot: pull the toes up toward the shin with the knee straight, and hold until the muscle eases.
  • Stand and put weight through the leg, or walk on it slowly.4
  • Massage the muscle, or aim a warm shower at the calf.

Paracetamol or ibuprofen can ease the soreness afterwards, but they work too slowly to stop a cramp that is happening. Avoid quinine: the FDA has warned it is not safe or effective for leg cramps.6

A night-time routine to keep cramps away

1. Stretch before bed

In a trial of 80 adults over 55 with night cramps, people who stretched their calves and hamstrings every night for six weeks had 1.2 fewer cramps a night than those who did not, and the cramps they did get were less painful.3 The routine was simple: stretch each calf and hamstring for 10 seconds, three times, just before going to sleep. Do it every night, not only after a bad one.

2. Take magnesium in the evening

Magnesium is the supplement most people reach for, and two trials give good reason to try it:

  • Adults with night cramps. In a 2021 trial of 175 adults aged 45 and over, one magnesium capsule at bedtime for 60 days led to a bigger drop in cramp episodes than placebo, along with better sleep quality.1
  • Pregnancy. In a trial of 80 pregnant women, 86% of those taking magnesium bisglycinate for four weeks cut their cramps by at least half, compared with 60.5% on placebo.2

Results vary from person to person, so the best way to find out is to try it for long enough and track how you feel.

Deep Rest is one magnesium bisglycinate capsule with 92.2 mg of elemental magnesium, taken before bed, so it slots straight into the stretching routine above. Bisglycinate is magnesium bound to glycine, which is easy on the stomach and less likely to cause the loose stools that cheaper forms such as magnesium oxide are known for. For a full comparison of forms, see magnesium glycinate, chelated, buffered and other forms. If you train hard, read how magnesium benefits athletes with sleep and muscle recovery.

3. Give it two months and keep a log

The adult trial ran for 60 days, so give magnesium about two months before you judge it.1 Note how many nights you wake with a cramp in the two weeks before you start, then compare at four and eight weeks. Keep your total magnesium from supplements under 350 mg a day, the adult upper limit, and add up every product you take.7 If you are pregnant, have kidney problems or take regular medicines, check with your doctor first.

4. Keep the basics in place

  • Move regularly during the day, and raise exercise intensity gradually.
  • Drink enough through the day.
  • Keep bedding loose around your feet so your toes are not pointed all night.

When to see a doctor

See a doctor if cramps last longer than 10 minutes, keep you awake most nights, or come with numbness, swelling or muscle weakness.4 Get help straight away if one calf becomes painful, swollen, red or warm, as that can be a sign of a blood clot.

Frequently Asked Questions

Is a night leg cramp dangerous?

Usually not. Night cramps are common and usually harmless. Get medical advice if a cramp lasts longer than 10 minutes, comes with swelling or numbness, or keeps you awake most nights.

Does magnesium help night leg cramps?

It may. In a 60-day trial, adults taking magnesium at bedtime had a bigger drop in cramps than those on placebo, and a pregnancy trial found most women on magnesium bisglycinate halved their cramps. Try it for about two months alongside nightly stretching.

Which form of magnesium is best for cramps?

Magnesium bisglycinate is a good choice for a nightly supplement: it was the form used in the pregnancy trial, and it is gentler on the stomach than magnesium oxide. Deep Rest uses magnesium bisglycinate in a once-daily capsule.

When should I take magnesium for night cramps?

In the evening, before bed. The adult trial used one capsule at bedtime, and taking it then fits naturally with a pre-sleep stretch.

Could a medicine be causing my cramps?

It is possible. Diuretics are the medicines most often linked to cramps. Do not stop a prescribed medicine on your own; ask your doctor whether an alternative suits you.

How long should I stretch before judging the result?

The trial that found a benefit used nightly stretching for six weeks, so keep going for at least that long.

This article is general information and does not replace advice from a doctor, pharmacist or midwife. Speak to a healthcare professional before starting a supplement if you are pregnant, take medicines, or have a long-term health condition.

References

  1. Barna O, Lohoida P, Holovchenko Y, Bazylevych A, Velychko V. A randomized, double-blind, placebo-controlled, multicenter study assessing the efficacy of magnesium oxide monohydrate in the treatment of nocturnal leg cramps. Nutrition Journal. 2021;20(1):90. PubMed 34719399
  2. Supakatisant C, Phupong V. Oral magnesium for relief in pregnancy-induced leg cramps: a randomised controlled trial. Maternal and Child Nutrition. 2015;11(2):139-145. PubMed 22909270
  3. Hallegraeff JM, van der Schans CP, de Ruiter R, de Greef MHG. Stretching before sleep reduces the frequency and severity of nocturnal leg cramps in older adults: a randomised trial. Journal of Physiotherapy. 2012. PubMed 22341378
  4. National Health Service (UK). Leg cramps. nhs.uk/conditions/leg-cramps
  5. NICE Clinical Knowledge Summaries. Leg cramps: causes. cks.nice.org.uk
  6. U.S. Food and Drug Administration. Serious risks associated with using quinine to prevent or treat nocturnal leg cramps. fda.gov (PDF)
  7. National Institutes of Health, Office of Dietary Supplements. Magnesium: Health Professional Fact Sheet. ods.od.nih.gov

Powered by RocketAEO

Back to blog