How to Stop Leg Cramps at Night (and Get Back to Sleep After One)

Written by

in

It is 3am and your calf suddenly locks into a hard, burning knot. You grab your leg, your toes curl on their own, and for a long minute you cannot think about anything else. Then it lets go, and you are left wide awake with a sore leg and a racing heart. If you are searching for how to stop leg cramps at night, you are not being dramatic. A night cramp can hurt a lot, and the hour after it is often where the sleep really goes.

Here is the short answer. When the cramp hits, straighten your leg and pull your toes up toward your shin, or stand up and press your foot flat on the floor. Rub the muscle, then put some warmth on it. To make cramps less likely, stretch your calves every evening just before bed, loosen the sheets at the foot of the bed, and drink enough through the day. If cramps are waking you often, last longer than 10 minutes, or come with numbness or swelling, get them checked.

Cramp gone but your body still wired? Try the free 5-minute sleep reset →

No password. We email you the link, and one tap opens your reset.

No password. We email you the link, and one tap opens your reset.

What is actually happening in your leg?

A night leg cramp is a muscle that tightens on its own and will not let go. It usually hits the calf, sometimes the foot, and less often the thigh. The NHS leg cramps page says a cramp can last from a few seconds to 10 minutes, and the muscle can feel sore for up to 24 hours afterwards. That leftover ache is why your calf still feels bruised the next morning.

The NHS also says leg cramps are common, usually harmless, and that most people get them at night or while resting. You are far from alone. The American Academy of Sleep Medicine reports that 33% of people over 60 have a sleep-related leg cramp at least once every two months, and that leg cramps happen in about 40% of pregnant women, usually easing after the baby is born. The AASM adds that cramps tend to come and go over the years, so a bad month does not mean a bad forever.

How to stop a leg cramp at night, right now

When the cramp grabs you, your instinct is to curl up and point your toes. Pointing your toes keeps the calf short, and the stretch you need goes the other way. So do the opposite.

  1. Pull your toes toward you. Straighten the cramped leg and flex your foot so your toes point up at your shin. Cleveland Clinic suggests pulling on your toes if you can reach them. If you cannot, loop the top sheet or a towel around the ball of your foot and pull gently.
  2. Or stand on it. The NHS says standing up and putting your weight on the leg with the cramp may help. Put your foot flat on the floor and lean forward a little. Hold the bedside table if you feel wobbly.
  3. Rub it. Stretching and massaging the muscle may ease the pain, according to the NHS. Use the heel of your hand and firm, slow strokes up the calf.
  4. Walk it out. Cleveland Clinic suggests walking around and wiggling your leg as you go. A slow lap of the bedroom is enough.
  5. Add warmth or cold. Cleveland Clinic lists a heating pad or a warm bath, or an ice pack wrapped in a towel. At 3am a hot water bottle you can fill quickly is the easy option. Many people find warmth feels better once the knot has let go and only the ache is left.

One thing that will not help in the moment: painkillers. The NHS says paracetamol or ibuprofen can ease the soreness after a cramp, but they will not help while it is happening, because they take too long to work.

Getting back to sleep after a cramp

The cramp itself is often over in a minute or two. What keeps you up is everything after it: the sore muscle, the shock of being woken by pain, and the fear that it will come back the moment you drift off. The AASM notes that the soreness after a cramp can make it hard to go back to sleep. So treat the next ten minutes as their own small job.

  • Settle the leg first. Lie on your back with a pillow under your calf, or on your side with a pillow between your knees, and keep your foot relaxed, not pointed.
  • Slow your breathing. The NHS breathing exercise is simple: in through your nose, out through your mouth, counting steadily from 1 to 5 each way if that helps, for at least 5 minutes. If you prefer a set rhythm, our 4-7-8 breathing guide walks you through it.
  • Do not lie there fighting it. The AASM healthy sleep habits advice is to get out of bed if you do not fall asleep after 20 minutes, and do something quiet in low light, away from screens. Sit with the hot water bottle on your calf, then go back when you feel sleepy.

If your leg has settled but your mind has not, our guide on how to fall back asleep in the middle of the night goes deeper on that part.

The 5-minute stretch that helps prevent night cramps

This is the one habit with real research behind it. In a randomised trial in the Journal of Physiotherapy, 80 people over 55 with night leg cramps were split into two groups. One group stretched their calf and hamstring muscles every night, just before going to sleep, for six weeks. They ended up with fewer cramps, and less painful ones, than the group that did not stretch. It was one small study, but it matches what the NHS and the AASM both recommend.

The NHS calf stretch goes like this:

  1. Stand facing a wall and stretch out your arms until your hands can just touch it. Stand up straight with your feet flat on the floor.
  2. Lean forward, pressing your hands against the wall, until you feel your calves stretch.
  3. Hold for 2 or 3 seconds, then stand up straight again.
  4. Repeat a few times for 5 minutes. The NHS suggests doing this 3 times a day, with the last one just before bed.

The NHS says that if your cramps become less frequent, you might only need to stretch once or twice a day. It also says the stretch may reduce cramps but may not stop them completely, which is honest and worth knowing. For the back of your thigh, a simple option is to sit on the edge of the bed with one leg straight out, heel on the floor, and lean forward gently until you feel a mild pull. If you want a fuller wind-down, our bedtime stretches fit nicely after the wall stretch.

Small bedtime changes that make cramps less likely

Untuck the sheets

Covers tucked in tight can press your toes down into a pointed position for hours. The AASM suggests untucking the sheets before you get under the covers. It takes ten seconds.

Keep your toes up

A Cleveland Clinic family doctor suggests that back sleepers use pillows to keep their toes pointing upward, and that stomach sleepers let their feet hang off the end of the bed. The idea is to stop your feet being held in a pointed position all night.

A little movement before bed

The same Cleveland Clinic advice includes gentle leg stretches or mild exercise, like a walk or a short bike ride, right before bed. Gentle is the key word. If your cramps follow a hard workout, our guide on how to sleep after leg day covers the evening after a heavy session.

Warmth before bed

The AASM says a massage or a hot shower before bed might be helpful. Let the warm water run over your calves for a minute, then do the wall stretch while the muscles are loose.

Drink enough, but time it well

The NHS lists not drinking enough fluids among the causes of leg cramps, and Cleveland Clinic suggests 6 to 8 glasses of water a day, more if you are active, especially outside. It also suggests limiting alcohol and caffeine, as another way to avoid getting dehydrated.

There is a catch for sleep. The AASM healthy sleep advice is to reduce how much you drink right before bed. So spread your water across the day rather than downing a big glass at 10pm. If you already wake up to pee, our guide on how to stop waking up at night to pee helps you find the balance. And if a nightcap is part of your evening, here is why alcohol wakes you up at night, cramps or not.

Why do I get leg cramps at night?

Often there is no clear reason. The NHS says the cause of some cramps is unknown, and Cleveland Clinic calls these idiopathic cramps. When there is a reason, these are the usual ones the NHS lists:

  • Getting older. Cleveland Clinic explains that tendons naturally shorten with age, which is one reason cramps get more common.
  • Too much strain on the muscles during exercise, which can be worse in hot or humid weather.
  • Pregnancy, usually in the later stage.
  • Certain medicines, for example statins for cholesterol and diuretics for high blood pressure. If you think a medicine is behind your cramps, talk to your doctor before you change anything. Do not stop a prescription on your own.
  • Not drinking enough fluids.
  • Liver disease from drinking too much alcohol.

Cleveland Clinic adds a few everyday ones for night cramps in particular: sitting for long periods, overusing your muscles, standing or working on concrete floors, and poor posture during the day. If your job keeps you on your feet or in a chair all day, the evening stretch matters even more.

Is it leg cramps or restless legs?

These two get mixed up all the time, and they need different help. A cramp is a muscle that locks tight and hurts. Restless legs is an uncomfortable, crawling urge to move your legs, usually in the evening as you try to settle. The AASM explains that restless legs usually does not involve pain or a tight muscle, and eases as soon as you move. A cramp needs more time and more stretching before it lets go.

If the description of restless legs sounds more like you, read how to sleep with restless legs or our guide to restless legs at night that keep you awake.

If it is your hands rather than your legs, going numb or buzzing until you wake, read hands going numb at night for what usually causes it and what helps.

Does magnesium help night leg cramps?

Magnesium is the supplement most people reach for, so it is worth being straight about it. A 2020 Cochrane review pooled 11 trials and concluded that magnesium is unlikely to give meaningful protection from cramps for older people with ordinary muscle cramps. For cramps in pregnancy, the studies disagreed and the authors said more research is needed. Some people in the trials also got stomach side effects such as diarrhoea.

So if you take magnesium for sleep and like it, that is your call, but do not count on it to fix the cramps. If you are curious about dosing anyway, our guide on how much magnesium for sleep covers the safe limits. The stretch is still the better bet.

You may also hear about quinine. The US FDA warns that quinine is not considered safe and effective for treating or preventing leg cramps, and links it to serious side effects. In the UK, the NHS says a GP may offer quinine tablets only if exercise has not helped, after talking through the risks. Either way, it is a decision for you and your doctor, never something to try on your own.

When to see a doctor about night leg cramps

Most night cramps are a painful nuisance and nothing more. 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

Cleveland Clinic also lists cramps in other parts of your body, changes in the skin of your leg, and waking over and over with cramps as reasons to talk to a provider soon. It advises going to the emergency room if a cramp lasts longer than 10 minutes or becomes unbearably painful, or if it comes after contact with something that could be poisonous or infected.

Notice that the first NHS point is about sleep. If cramps are costing you nights, that alone is reason enough to book the appointment. You do not have to just put up with it.

Tonight, keep it simple

Five minutes of the wall stretch before bed. Sheets loose at the foot of the bed. Toes up, not pointed. A glass of water earlier in the evening, not at the last minute. And if the cramp still comes, pull your toes toward you, stand on it, rub it out, then breathe slowly until your body settles. You do not need a perfect night. You only need to stop one cramp from stealing the rest of it, so tomorrow you wake up clear instead of limping into the day on four hours.

Leg calm but still wide awake? Get the free 5-minute sleep reset →

No password. We email you the link, and one tap opens your reset.

No password. We email you the link, and one tap opens your reset.

This article is general information, not medical advice. If leg cramps are new, severe or getting worse, please see a doctor.