Leg cramps at night are sudden, painful tightenings of the calf or foot muscles that wake you from sleep, and the cause is often unknown. They affect about half of adults over 60, and possible contributors include medicines such as diuretics and statins, pregnancy, and some nerve, circulation, and metabolic conditions. To stop a cramp, stretch the muscle. To prevent them, calf stretching before bed has mixed but encouraging evidence. Magnesium supplements, a popular remedy, did not help older adults in a Cochrane review. Quinine is effective but carries serious risks and is not approved for cramps. See a doctor if cramps are frequent, one-sided, or come with swelling, redness, weakness, or numbness. This is educational information, not medical advice.
What are leg cramps at night, and how common are they?
Nocturnal leg cramps are sudden, involuntary, painful muscle contractions, usually in the calf, that happen at rest and often at night. Most last seconds to minutes. People often call them a charley horse.
They are common. Among people over 60, almost half report leg cramps, about a third say cramps wake them at night, and 15% report weekly episodes. The pain can interrupt and impair sleep, though cramps do not cause permanent injury.
Other nighttime leg problems feel different, so it helps to tell them apart:
- Night leg cramp: a sudden, painful, tight muscle, usually the calf. Stretching usually stops it.
- Restless legs syndrome: an uncomfortable urge to move, not a painful contraction. See restless legs syndrome.
- Claudication: leg pain with walking that eases with rest, which can point to a circulation problem.
- Numbness or tingling: a nerve issue. See numbness and tingling at night.
What causes leg cramps at night?

Often, nobody knows. The cramp itself comes from repetitive firing of motor units in the muscle, but what triggers it is not known, and most cases are idiopathic, meaning no clear cause. Here are the possible contributors, with a clue and a first step:
- Medicines. Clue: cramps began after a new medicine. Diuretics (especially thiazide and potassium-sparing types), long-acting beta-agonist inhalers, statins, raloxifene, and others are linked. It is not clear statins cause night cramps specifically. First step: ask your prescriber or pharmacist to review your list. Do not stop prescribed medicines on your own.
- Pregnancy. Clue: calf cramps in the later months. First step: ask your clinician, and report one-sided swelling.
- Circulation, nerve, and metabolic conditions. Peripheral artery disease, spinal stenosis, diabetes, and thyroid, liver, and kidney problems are associated with cramps. Clue: weakness, numbness, leg pain with walking, or other symptoms. First step: a medical evaluation.
- Dehydration, electrolytes, and long sitting. These are commonly blamed, but evidence that electrolyte changes cause night cramps is weak.
- Age. Cramps become more common after 60.
Clinicians sometimes check electrolytes, calcium, magnesium, kidney function, blood sugar, and thyroid, and may use Doppler ultrasound if circulation is a concern.
How do you stop a leg cramp when it happens?

Stretch the muscle. That usually stops it.
- Straighten your leg and pull your toes up toward your shin. Hold until the cramp eases.
- Stand and put weight on the leg, or walk around.
- Massage the calf. Heat or massage is often recommended, though good evidence is limited.
- Seek care if the leg is swollen, red, or warm, or if the pain does not ease.
What helps prevent leg cramps at night?

The honest answer is that nothing is well proven. Here is how the options stack up:
- Stretching before bed. The evidence is mixed. A 2012 trial in 80 adults over 55 found that stretching the calves and hamstrings at bedtime reduced cramp frequency and severity more than no stretching. Earlier reviews of older adults found that stretching three times a day for 12 weeks did not reduce cramps compared with sham exercise, and the American Academy of Neurology says there are not enough data to be sure. It is low risk, so it is a reasonable first try.
- Medication review. Worth doing if a drug may be involved.
- B vitamins. A 12-week trial of 28 older adults with high blood pressure found cramps went into remission in 86% of those on B complex. The trial was small and low quality, so treat it as a hint, and ask a clinician first.
- Prescription options. A clinician may consider a calcium channel blocker such as diltiazem, which the American Academy of Neurology rates as possibly effective, after weighing risks.
- Heat, massage, and staying active. Commonly recommended, but evidence is limited.
Does magnesium help leg cramps at night?
Probably not. A 2020 Cochrane review found moderate-quality evidence that magnesium is not effective for treating or preventing cramps in older adults. The American Academy of Neurology and a 2017 evidence summary reached similar conclusions. In one small trial, cramps halved in both the magnesium and placebo groups, with no difference between them.
It is not known whether magnesium helps cramps in pregnancy, liver disease, other conditions, or after exercise. Some pregnancy studies are more favorable, but the benefit is not dramatic. People with kidney disease can build up magnesium, so ask a clinician before taking it.
If you want the broader picture, read our guide to magnesium for sleep.
Do cramps keep waking you along with other nighttime body symptoms? If you would like to see how we might be able to help you with this deeper, schedule a free consult here.
What about quinine?
Skip it. Quinine reduces cramps, but it is no longer recommended. Major adverse effects include low platelets (thrombocytopenia), severe allergic reactions, and QT prolongation, which can lead to dialysis or death. The FDA has not approved quinine for leg cramps and has warned against using it. After the FDA acted in 2010, use in the US dropped sharply.
When should you see a doctor about leg cramps at night?
See a doctor if:
- One leg is swollen, red, warm, or tender. This can signal a blood clot. Seek urgent care.
- Cramps are frequent or severe, or wake you most nights, or keep coming despite self-care.
- You have weakness, numbness, tingling, or skin color changes, or leg pain with walking that eases with rest.
- Cramps began after a new medicine.
- You are pregnant and cramps are severe or come with swelling.
For related symptoms, see burning feet at night and our guide on sleep and chronic pain.
What the Research Shows
Magnesium is not effective in older adults. A 2020 Cochrane review of magnesium for skeletal muscle cramps found moderate-quality evidence that it is not effective for treating or preventing cramps in older adults. It is not known whether it helps cramps from pregnancy, liver cirrhosis, other conditions, or exercise. A 2017 American Family Physician evidence summary cited a 2014 systematic review that found no evidence to support magnesium, analgesics, anti-epileptic drugs, verapamil, or vitamin E for idiopathic night cramps.
Stretching has mixed results. A 2012 randomized trial in 80 adults over 55 found that bedtime stretching of the calves and hamstrings reduced cramp frequency and severity more than no stretching over six weeks. But systematic reviews in 2010 and 2012, covering 191 patients over 60, found that stretching three times a day for 12 weeks did not reduce cramp frequency compared with sham exercise. The American Academy of Neurology says there are not enough data to say for sure.
Quinine works, but at a high price. Three systematic reviews found oral quinine significantly reduced the frequency, intensity, and number of days with cramps. Major adverse effects, including thrombocytopenia, acute hypersensitivity reactions, and QT prolongation, can lead to hemodialysis or death. The FDA has not approved quinine for leg cramps, so clinicians should only consider it after discussing severe risks, and the AFP summary says it is no longer recommended.
B vitamins and calcium channel blockers: small, low-quality evidence. The AFP summary concluded that calcium channel blockers or B vitamins may lead to short-term improvement, based on small, low-quality trials. A 12-week trial of 28 older adults with high blood pressure found B complex induced remission in 86%. A crossover study of 13 patients found diltiazem cut the number of cramps from 5.8 to 0.16 per two-week phase but did not change intensity. Details such as allocation concealment and completion rates were often not reported.
This article is for education only and is not medical advice. Talk with a qualified clinician about your own sleep, health conditions, and medications.
If you would like to see how we might be able to help you with this deeper, schedule a free consult here.
Want a hand with the nighttime symptoms behind poor sleep?
Join The Sleep Nirvana Club, our free sleep course and community: Join the free sleep course and community.
When to Seek Professional Help
- One leg is suddenly swollen, red, warm, or tender. This can signal a blood clot, so seek urgent care.
- Cramps are frequent, severe, or wake you most nights, or they persist despite stretching and self-care.
- You have weakness, numbness, tingling, or skin color changes, or leg pain with walking that eases with rest.
- Cramps began after you started a medicine such as a diuretic, a statin, or an asthma inhaler. Talk with your prescriber, and do not stop it on your own.
- You are pregnant with severe cramps or swelling, or you have kidney disease and are thinking about taking magnesium. Ask a clinician first.
Frequently Asked Questions
Why do I get leg cramps at night?
Often nobody knows. Most nocturnal leg cramps have no clear cause. Possible contributors include some medicines such as diuretics, long-acting inhaled beta-agonists, and statins, pregnancy, and conditions that affect nerves, circulation, or metabolism, including diabetes, thyroid, kidney problems, spinal stenosis, and peripheral artery disease. Dehydration and electrolyte shifts are often blamed, but the evidence linking them to night cramps is weak. If cramps are frequent or come with other symptoms, ask a clinician.
How do I stop a leg cramp right away?
Stretch the muscle. Straighten your leg, then pull your toes up toward your shin and hold until the cramp eases. Standing and putting weight on the leg, walking around, or massaging the calf can also help. Heat is commonly recommended too, although good evidence is limited. Most cramps settle within seconds to minutes. If the leg is swollen, red, or warm, or the pain does not ease, seek medical care.
Does magnesium help leg cramps at night?
Probably not. A 2020 Cochrane review found moderate-quality evidence that magnesium is not effective for preventing or treating cramps in older adults. It is not known whether it helps cramps in pregnancy or other conditions, and some pregnancy studies are more favorable. In one small trial, cramps halved in both the magnesium and placebo groups. Magnesium can build up in people with kidney disease, so ask a clinician before trying it.
What medications cause leg cramps at night?
Several medicines are linked to night cramps, including thiazide and potassium-sparing diuretics, long-acting beta-agonist inhalers, and statins. Others include raloxifene and some blood pressure and asthma drugs. Statins are linked to muscle pain, though it is not clear they cause night leg cramps specifically. If cramps began after a new medicine, tell your prescriber. Do not stop a prescribed medicine on your own.
When are leg cramps at night a sign of something serious?
See a doctor promptly if one leg is swollen, red, warm, or tender, which can signal a blood clot. Also get checked if cramps are frequent, severe, or disturb your sleep most nights, if you have weakness, numbness, tingling, or skin color changes, or if leg pain with walking eases with rest. Cramps that start after a new medicine, or that occur in pregnancy with swelling, also deserve a medical review.
When to Work With a Sleep Consultant
We do not diagnose or treat leg cramps, and any red-flag symptom should go to your doctor first. What The Sleep Consultant can do is work alongside them. We look at the root causes that fragment your sleep, such as medicines you may want reviewed, nutrient status, hydration habits, stress, and circadian rhythm, so your nights are calmer.







