Skip to content

Muscle cramps and magnesium

Dr. Ladd Carlston · Overland Park, KS · Updated October 28, 2026

Most night leg cramps have no single known cause. The best explanation is a tired muscle plus a nerve that fires when it should stay quiet, often while your calf is resting short with your toes pointed. They get more common with age and in pregnancy, and some medicines and medical conditions make them more likely.

A calf that seizes in the night, a foot that locks when you stand, a cramp in the middle of a workout. People ask me about magnesium for all three. Here is the short version, then the detail: for typical night leg cramps in older adults, a large review found magnesium is unlikely to help. In pregnancy the evidence is mixed. A supplement is not something to start without your own doctor.

What causes night leg cramps

Ordinary muscle cramps are not fully understood. Mayo Clinic and the American Family Physician review both say most night cramps have no known cause. The clinical word is idiopathic, which means the cause has not been identified.

The leading ideas are muscle fatigue and a nerve that fires when it should stay quiet. The American Family Physician review describes electromyography research in which leg cramps show up as an uncontrolled burst of nerve firing. That is the best current account, and it is still not a complete explanation. The same review is plain about the popular explanation: neither night cramps nor exercise cramps have been tied to dehydration, or to low potassium, sodium, or magnesium. Mayo Clinic and the NHS still list dehydration as a possible trigger. A severe mineral imbalance can cause cramps. That is a medical problem a physician sorts out. It is not the usual story behind a calf that grabs at 2 a.m.

Position may matter too. When you lie down, your foot tends to drop into a pointed position, and heavy or tucked-in covers push it further. That leaves the calf at its shortest, and the American Family Physician review describes this as one way a misfiring nerve can set off a cramp. Cleveland Clinic also lists long hours of sitting at a desk, standing on concrete floors, and overused muscles. Mayo Clinic lists a lack of physical activity.

Cramps during exercise got a fresh look in 2026. A systematic review in Muscle & Nerve pulled together nine studies that followed about 11,000 athletes over time. Of everything the researchers tested, one predictor stood out: athletes who had cramped before were about 4.4 times as likely to cramp again. Age, body weight, and height showed no link. Hydration, training, and routine showed no consistent link either. The authors’ reading is that exercise cramps tend to recur in the same people, and that the usual prevention advice built on fluids and training load is on shakier ground than most of us were taught. They also said much of the evidence is still limited. If you cramp in the same spot every time you run or play, I take that as a pattern to test, not bad luck.

A few associations are real. Pregnancy is one, though it is hard to separate pregnancy itself from the vein changes that come with it. Medicines are another, and the evidence is uneven. A 2012 study of prescription records in British Columbia found that treatment for night cramps was more likely in the year after people started a potassium-sparing diuretic, a thiazide-like diuretic, or an inhaled long-acting beta agonist. The link was smaller for loop diuretics and for statins. The American Family Physician review, published the same year, noted that this kind of study can be muddied by worsening illness and by people simply seeing the doctor more, and that a common diuretic such as hydrochlorothiazide has not been shown to cause the cramps. The same review names intravenous iron sucrose, conjugated estrogens, raloxifene, naproxen, and teriparatide as the medicines most often tied to leg cramps, though the review says the overall rate is very low. If yours started after a new prescription, tell the doctor who wrote it. Do not stop a prescribed medicine because of something you read here.

Who gets them

Night cramps in the calf are the ones people describe most. Cramps in the foot and the thigh are common too, and so are cramps during or right after exercise. A review in American Family Physician reported nocturnal leg cramps in 50 to 60 percent of adults. Pregnancy and older age are the two settings where rest cramps show up most often. Hard exercise is another. Some people cramp as part of another medical condition. Mayo Clinic lists poor blood flow in the legs, nerve damage such as from diabetes, lumbar spinal stenosis, kidney failure and dialysis, cirrhosis, thyroid disease, and Parkinson’s disease.

In pregnancy, NHS inform says the extra weight strains the leg muscles, and the cramps should pass after the baby is born. Ask your doctor or midwife before you try a supplement.

Cramp or restless legs?

A true cramp is a sudden, hard knot in the calf or foot, often at night. The NHS says a cramp can last from a few seconds to 10 minutes, and the muscle can stay sore for up to 24 hours afterward. An urge to move your legs that is uncomfortable but not painful, and that eases when you move, is more like restless legs syndrome. That is a different condition, and it is worth raising with your doctor.

How to stop a cramp right now

Straighten your knee and pull your toes up toward your shin, or stand up and press your heel into the floor. Then walk around and rub the muscle. The NHS and Cleveland Clinic both describe these steps, and the NHS notes that most cramps go away on their own.

What magnesium does, and what it does not

Magnesium is sold for cramps. The trials do not support that for the night cramps most older adults get.

In 2020, Cochrane published a review of the randomized trials. For idiopathic cramps, mostly in older adults and mostly at night, magnesium was unlikely to reduce how often the cramps came or how severe they were. The reviewers called that moderate-certainty evidence. In pregnancy, the trials did not agree with each other, the studies had important limits, and the reviewers were very uncertain whether magnesium helps. They found no randomized trials of magnesium for cramps that come with exercise, and only one small, inconclusive study in people with liver disease.

An older clinical review was more hopeful about magnesium as a treatment. The Cochrane review is the one that pooled the trials, and it is the one I go by.

Severe magnesium deficiency is a different condition. The National Institutes of Health notes that as deficiency gets worse, people can develop numbness, muscle contractions and cramps, seizures, and abnormal heart rhythms. Symptomatic deficiency from diet alone is uncommon in otherwise healthy people. A routine blood test is also an imperfect check, because almost all of the body’s magnesium sits in bone and inside cells, not in the serum. If you and your doctor think you are actually deficient, that decision belongs with them.

The bottom line, as plainly as I can put it: if you are an older adult with ordinary night cramps, the best evidence says a magnesium supplement probably won’t change how often they come or how bad they are. If you are pregnant, nobody knows yet, and that call belongs with your doctor. If your cramps come with exercise, magnesium has never been properly tested for that. Stretching (below) has better evidence than any of it.

Food, side effects, and who should ask a doctor

Food is the reasonable way to get magnesium. The NIH lists green leafy vegetables such as spinach, along with legumes, nuts, seeds, and whole grains. Fortified breakfast cereals, yogurt, and milk contribute too. Magnesium from food is not the hazard. In a person with healthy kidneys, the kidneys clear what you do not need.

A supplement is a different product. High doses from supplements, and from magnesium laxatives and antacids, often cause diarrhea, nausea, and abdominal cramping. If your kidneys do not work well, clearing magnesium gets harder, and too much of it is dangerous. Do not start a magnesium supplement if you have kidney disease unless your own doctor tells you to.

Magnesium also interacts with medicines. It can block absorption of some antibiotics and of osteoporosis drugs taken by mouth, such as bisphosphonates. Some diuretics increase the magnesium lost in urine. Potassium-sparing diuretics do the opposite. Proton pump inhibitors, the acid-reducing medicines, can lower magnesium when they are taken for a long time, often more than a year. I am not going to suggest a dose. Talk with your doctor before you supplement, and bring the rest of your medicine list.

That conversation is reasonable if you are pregnant and cramping, if you take a diuretic or have been on an acid reducer for a long time, if your doctor has already said your magnesium is low, or if your meals rarely include the foods above. I would not count on a supplement to stop a typical night cramp in an older adult.

Vitamin K2: one early trial

In 2024, a double-blind trial in JAMA Internal Medicine tested vitamin K2 for night leg cramps in 199 adults aged 65 and older. About half took 180 mcg of vitamin K2 (MK-7) a day for 8 weeks, and the rest took a look-alike placebo. Cramps in the vitamin K2 group fell from about 2.6 a week to about 1, while the placebo group went from about 2.7 to about 3.6. The researchers found no side effects they linked to vitamin K2. It is one trial, only in adults 65 and older, and no one has repeated it yet. The journal retracted the paper and republished it in corrected form in 2025, after questions about how it reported people who dropped out. A supplement maker supplied the capsules. I see it as promising early evidence, not a cure, and I am not suggesting a dose. Check with your doctor first, especially if you take a blood thinner like warfarin, because vitamin K affects how it works. You can read the trial on PubMed.

A bedtime stretch that has been tested

Stretching is the self-care step with the best trial behind it, though the evidence is mixed. In a 2012 trial, 80 adults over 55 with night leg cramps were randomly assigned either to stretch their calves and hamstrings every night just before bed or not to stretch. After six weeks the stretching group had fewer cramps, about one fewer per night than the other group, and the cramps they did have hurt less. Everyone finished the study.

An earlier trial, published in 2005, did not find a benefit. It enrolled 191 people in England who were taking quinine for night cramps, and advice to do calf stretches made no difference to how many cramps they had at 12 weeks. Stretching is cheap and safe, so it is still worth trying.

Here is how I’d do it:

  • Calf: Face a wall with your hands on it. Step one foot back, keep that heel on the floor and the knee straight, and lean in until you feel the stretch in the calf. Hold, then switch legs.
  • Hamstring: Sit on the edge of the bed with one leg straight out and the heel on the floor. Keep your back long and hinge forward from the hips until you feel the back of the thigh. Hold, then switch.
  • Do it right before you lie down, every night, for at least six weeks before you decide whether it’s working.

Two other bedtime steps are easy. Keep your sheets and blankets loose so your feet aren’t pushed into a point. NHS inform suggests that if you sleep on your back, you keep your toes pointing up, for example with a pillow propped against the soles of your feet. If you sleep on your front, let your feet hang over the end of the bed. During the day, break up long stretches of sitting.

A stretch should feel like a pull, not pain. If you have trouble with balance, do the calf stretch holding a counter. If stretching doesn’t change anything, or the same muscle stays tight during the day, that’s when testing the muscle makes sense.

Don’t use quinine for cramps

Quinine used to be prescribed for night cramps. The FDA says it is approved only for malaria and is not considered safe and effective for leg cramps. It has been linked to serious, sometimes fatal, blood and heart reactions. If you still have an old prescription, talk with your doctor before you take it.

When the cramp is a muscle problem

I do not treat low magnesium. I work on tight and sore muscles, and I use muscle testing to find muscles that have stopped firing.

Here is the pattern where hands-on work is worth considering. The cramp keeps hitting the same place. The muscle stays tight after the cramp lets go. Or it started after an injury, or after that muscle had been overworking for a long time. In those cases I am often looking at a muscle and fascia problem, not a mineral problem. I test which muscles are firing and which have shut down, then work on the tissue I find. No popping or cracking. How a session actually goes is on the Muscle Reset Technique page.

A visit will not stop every cramp. Night cramps in older adults are often idiopathic, and neither a capsule nor a session has a strong claim on those. If the testing shows a muscle that has stopped firing and tissue that will not let go, that is a specific problem, and it is the one I know how to work on. Your first visit is $100, cash pay, a full 30 minutes, one-on-one. I do not bill insurance.

When to see a physician instead

Some of this does not belong in my office, and it should not wait on a supplement.

Get medical care the same day if a cramp comes with swelling, redness, or warmth in the calf. The CDC lists swelling, pain, warmth, and redness or discoloration as the common signs of a blood clot in a deep vein of the leg, and says to see a doctor as soon as possible. If you also have chest pain, trouble breathing, or you cough up blood, call emergency services.

See your physician promptly, before you book with me, if:

  • the cramps started after a new medicine
  • they come with weakness, numbness, or swelling
  • a cramp lasts longer than 10 minutes (NHS inform says to contact your doctor urgently if it also doesn’t get better when you start to move)
  • they keep waking you up
  • your leg muscles are shrinking or getting weaker
  • they show up in other parts of your body too
  • they are very frequent, or they are new and getting worse

Those need a medical check for a drug effect, a nerve problem, or a metabolic one. I am glad to look at the muscle once a physician has ruled out the things that are not mine to handle.

If the same spot keeps locking up

If the cramp is part of a muscle that stays tight, or a pattern that started after an injury, I can test it and tell you what I find. I see patients in Overland Park. You can book online. If any of the warning signs above apply, see a physician first.

Book a visit

Sources

  1. Garrison SR, Korownyk CS, Kolber MR, Allan GM, Musini VM, Sekhon RK, Dugré N. Magnesium for skeletal muscle cramps. Cochrane Database of Systematic Reviews. 2020, Issue 9. Art. No. CD009402. Read the Cochrane review
  2. Allen RE, Kirby KA. Nocturnal leg cramps. American Family Physician. 2012;86(4):350-355. Read the American Family Physician review
  3. Garrison SR, Dormuth CR, Morrow RL, Carney GA, Khan KM. Nocturnal leg cramps and prescription use that precedes them: a sequence symmetry analysis. Archives of Internal Medicine. 2012;172(2):120-126. Read the prescription study
  4. National Institutes of Health, Office of Dietary Supplements. Magnesium: fact sheet for health professionals. Read the NIH fact sheet
  5. Centers for Disease Control and Prevention. About venous thromboembolism (blood clots). Read the CDC page on blood clots
  6. Costa LDS, et al. Risk factors for exercise-associated muscle cramps: a systematic review with meta-analysis. Muscle & Nerve. 2026;74(5):1375-1386. https://pubmed.ncbi.nlm.nih.gov/42693659/
  7. Hallegraeff JM, et al. Stretching before sleep reduces the frequency and severity of nocturnal leg cramps in older adults: a randomised trial. Journal of Physiotherapy. 2012;58(1):17-22. https://pubmed.ncbi.nlm.nih.gov/22341378/
  8. Coppin RJ, Wicke DM, Little PS. Managing nocturnal leg cramps: calf-stretching exercises and cessation of quinine treatment. British Journal of General Practice. 2005;55(512):186-191. https://pubmed.ncbi.nlm.nih.gov/15808033/
  9. U.S. Food and Drug Administration. Serious risks associated with using quinine to prevent or treat nocturnal leg cramps. Read the FDA warning
  10. Mayo Clinic. Night leg cramps: causes. Read the Mayo Clinic page
  11. NHS. Leg cramps. Read the NHS page
  12. NHS inform. Leg cramps. Read the NHS inform page
  13. Cleveland Clinic. Leg cramps. Read the Cleveland Clinic page
  14. Tan J, Zhu R, et al. Vitamin K2 in managing nocturnal leg cramps: a randomized clinical trial. JAMA Internal Medicine. 2024;184(12):1443-1447. Retracted and replaced in corrected form, 2025. https://pubmed.ncbi.nlm.nih.gov/39466236/

Medical disclaimer

The content on this page is for educational and informational purposes only. It is not medical advice, and it is not a substitute for professional medical advice or an in-person evaluation by a licensed healthcare provider. Nothing here diagnoses, treats, cures, or prevents any disease.

Do not disregard professional medical advice, or delay seeking it, because of something you read here. If you have a health concern, talk with your physician, or raise it with Dr. Ladd Carlston at an in-person visit.

Does magnesium help night leg cramps?

A 2020 Cochrane review found that magnesium is unlikely to reduce how often typical night leg cramps come, or how bad they are, in older adults. In pregnancy the trials disagree, so any benefit is uncertain. The review found no randomized trials of magnesium for cramps that come with exercise. Talk with your doctor before you take a supplement. This page does not suggest a dose.

What causes leg cramps at night?

For most people, the cause is not fully known. Clinicians call those cramps idiopathic. Muscle fatigue and a nerve that fires when it should not are the leading ideas, often while the calf rests short with the toes pointed. Dehydration and low electrolytes are often blamed, but a clinical review did not find that link for ordinary night cramps or exercise cramps. Pregnancy, older age, some medicines, and some medical conditions are real associations.

How do I stop a leg cramp fast?

Straighten your knee and pull your toes up toward your shin, or stand up and press your heel into the floor. Then walk around and rub the muscle.

Is quinine safe for night leg cramps?

No. The FDA says quinine is not considered safe and effective for leg cramps, and it has been linked to serious, sometimes fatal, blood and heart reactions.

When should muscle cramps be checked by a physician right away?

The same day, if a cramp comes with swelling, redness, or warmth in the calf. Those can be signs of a blood clot. Call emergency services if you also have chest pain, trouble breathing, or you cough up blood. See your physician promptly if the cramps started after a new medicine, come with weakness, numbness, or swelling, last longer than 10 minutes, keep waking you up, or are happening very often.

Does drinking more water prevent cramps during exercise?

A 2026 review of studies that followed about 11,000 athletes found no consistent link between hydration and exercise cramps. The strongest predictor was having cramped before. Drink to thirst for other good reasons, but don't count on water alone to stop a cramp that keeps coming back.

When might a visit help a cramp that keeps coming back?

When the same spot keeps cramping, the muscle stays tight between episodes, or the pattern started after an injury. That can be a muscle and fascia problem I can test in the office. It is not a promise that the cramps will stop, and it is not a substitute for a physician when the warning signs above are present.

Ready to find real relief?

Book online in 30 seconds. No referral needed.