Leg Cramps at Night: Causes, Quick Relief and 8 Ways to Prevent Them
Leg cramps at night waking you up? Learn what causes nighttime calf cramps, how to stop one fast, and 8 simple habits that may help prevent them.

You’re sound asleep, and suddenly your calf locks into a hard, painful knot that jolts you awake. If you’ve been there, you know a leg cramp at night can feel far bigger than it looks, and the soreness can hang around the next day.
The good news: night leg cramps are common and usually harmless. Here’s what’s behind them, how to stop a cramp fast, and the habits that may help you have fewer of them.
Quick Summary
- Night leg cramps usually hit the calf. The feet and thighs can cramp too.
- Most have no clear cause. Tired muscles, nerve issues, age, pregnancy and some medicines play a role.
- To stop a cramp, stretch it out. Flex your foot up toward your face, then walk or massage the muscle.
- Gentle stretching before bed may help. Evidence is limited, but it’s low-risk and easy to try.
- Don’t use quinine for cramps. The FDA warns it can cause serious side effects.
What Are Leg Cramps at Night?
The Mayo Clinic describes night leg cramps (also called nocturnal leg cramps) as leg muscles suddenly tightening during sleep. They usually involve the calf, though the feet or thighs can cramp as well. Many people know them as a “charley horse.”
According to the NHS, a cramp can last from a few seconds to 10 minutes, and the muscle may feel sore for up to 24 hours afterward. Cleveland Clinic notes that they happen most often to older adults and are also common during pregnancy.
Leg cramps vs. restless legs
These two get mixed up a lot. A cramp is a sudden, painful tightening of a muscle. Restless legs syndrome is an uncomfortable urge to move your legs when you’re lying still, and Mayo Clinic notes it usually isn’t painful and lasts longer than a cramp. If the urge to move sounds more like you, read our guide to restless legs at night.

What Causes Leg Cramps at Night?
Mayo Clinic says that most of the time there’s no known cause, and night leg cramps are likely the result of tired muscles and nerve issues. Still, a few things are linked to them.
Age and pregnancy
The risk rises as you get older, and pregnant people are more likely to get night leg cramps, according to Mayo Clinic. The NHS says pregnancy cramps usually show up in the later stages. Our tips on how to sleep during pregnancy cover other common discomforts too.
Daily habits
Cleveland Clinic lists sitting for long periods, overusing your muscles, standing or working on concrete floors and poor posture as possible causes of nighttime leg cramps. The NHS adds that straining muscles during exercise, especially in hot or humid weather, and not drinking enough fluids can trigger cramps.
Medicines
Mayo Clinic lists some medicines used to treat blood pressure and high cholesterol, as well as birth control pills, among common causes. The NHS specifically mentions statins and diuretics (water pills). Never stop a prescription on your own, but it’s worth asking your doctor or pharmacist if your cramps started after a new medicine.
Health conditions
Kidney failure, diabetic nerve damage and problems with blood flow are known to cause night leg cramps, Mayo Clinic says, though people with these conditions usually have other symptoms as well. Thyroid problems, peripheral artery disease and spinal stenosis are also on its list of linked conditions.
How to Stop a Leg Cramp Fast
When a cramp hits, the goal is to lengthen the tight muscle. These steps come from Mayo Clinic and the NHS:
- Flex your foot. Straighten your leg and pull your toes up toward your face to stretch the calf.
- Stand up and put weight on it. The NHS says standing on the cramping leg may help.
- Walk or shake the leg. A few steps around the bedroom can help the muscle let go.
- Massage the muscle. Rub the knot gently, or try massaging it with ice, as Mayo Clinic suggests.
- Use warmth. A hot shower aimed at the muscle or a warm bath can ease it.
The NHS notes that over-the-counter pain relievers can help with soreness afterward, but they work too slowly to stop a cramp while it’s happening.

8 Ways to Prevent Leg Cramps at Night
There’s no guaranteed fix, but these low-risk habits may help you have fewer cramps.
1. Stretch your calves before bed
The NHS recommends a simple wall stretch: stand facing a wall, lean in with your feet flat until you feel a stretch in your calves, hold for a few seconds and repeat for about five minutes, with the last round just before bed. A Cochrane review found very low-certainty evidence that daily calf and hamstring stretching may reduce the severity of night cramps in people over 55. It’s not proven, but it’s easy and safe for most people. Try our bedtime stretches for better sleep as part of your wind-down.
2. Try a short ride before bedtime
Mayo Clinic suggests riding a stationary bike for a few minutes before bed as another way to loosen your leg muscles.
3. Drink enough fluids during the day
Dehydration is one of the common causes Mayo Clinic lists. Sip water throughout the day rather than chugging a big glass right before bed, which can send you to the bathroom at 2 a.m. Here’s how much water to drink before bed.
4. Go easy on alcohol and caffeine
Mayo Clinic advises limiting both. Alcohol also tends to fragment sleep, as we explain in alcohol and sleep.
5. Loosen your sheets
Tightly tucked covers can hold your feet pointed down for hours, which shortens the calf. Mayo Clinic recommends loosening the sheets and covers at the foot of the bed.
6. Move more during the day
Lack of physical activity and long stretches of sitting are both linked to cramps. Take short walking breaks if you have a desk job, and see does exercise help you sleep for how regular activity helps your nights too.
7. Review your medicines
If cramps started after a new prescription, ask your doctor whether it could be related and whether there are other options.
8. Skip the quinine and be realistic about magnesium
In the past, quinine was used for leg cramps, but the FDA warns against using it to prevent or treat nighttime leg cramps because of serious risks, including dangerous blood problems. Magnesium is a popular home remedy, but a Cochrane review concluded it’s unlikely to meaningfully prevent cramps in older adults. If you’re curious about magnesium for other reasons, read magnesium for sleep and check with your doctor first.

Quick Guide: Cramp Relief at a Glance
| Situation | What to try |
|---|---|
| Cramp is happening now | Flex your foot toward your face, stand on the leg, walk or massage |
| Sore muscle afterward | Warm shower or bath, gentle stretching, pain reliever if needed |
| Frequent night cramps | Calf stretches before bed, steady fluids, loose sheets, less sitting |
| Cramps started with a new medicine | Ask your doctor or pharmacist, don’t stop it on your own |
When to See a Doctor
Most night leg cramps are just a nuisance. Mayo Clinic says to seek care right away for severe cramping that won’t stop, or cramps after contact with a toxin such as pesticides or heavy metals. Make an appointment if cramps leave you tired during the day or come with muscle weakness or loss of muscle mass. The NHS also recommends seeing a doctor if cramps disturb your sleep, last longer than 10 minutes, or come with numbness or swelling in your legs.
If cramps keep waking you up, our guide to waking up in the middle of the night has tips for getting back to sleep.
The Bottom Line
Leg cramps at night are painful but usually harmless. When one strikes, stretch the muscle by flexing your foot, then stand, walk or massage it. To cut down on future cramps, try calf stretches before bed, stay hydrated during the day, loosen your sheets and keep moving. If cramps are frequent, severe or come with other symptoms, talk to your doctor.
FAQ: Leg Cramps at Night
Why do I get leg cramps at night but not during the day?
Cramps can happen any time, but the NHS says most people get them at night or while resting. Long periods of sitting during the day and feet pointed down under tight covers may contribute.
What is the fastest way to stop a calf cramp?
Straighten your leg and pull your toes up toward your face to stretch the calf. Standing on the leg, walking and massaging the muscle can also help it release.
Does magnesium help leg cramps at night?
A Cochrane review found magnesium is unlikely to meaningfully prevent cramps in older adults. Talk with your doctor before starting any supplement, especially if you have kidney problems or take other medicines.
Are night leg cramps a sign of something serious?
Usually not. Most have no clear cause. But see a doctor if cramps are severe, frequent, disrupt your sleep, or come with weakness, numbness or swelling.
This article is for general information only and isn’t medical advice. If leg cramps are severe, frequent or come with numbness, swelling or weakness, talk with a doctor. Don’t stop or change a prescribed medicine without talking to your health care provider.
General guidance, not medical advice. If a sleep problem persists or gets worse, speak to a qualified clinician. Medical disclaimer