- 01Most night cramps aren't caused by low potassium or dehydration
Bananas and water are the folk remedy, but the American Family Physician review found night-time and exercise cramps haven't been linked with dehydration or with low potassium, sodium or magnesium. They are mostly put down to muscle fatigue and nerve misfiring, and become more common with age. Mineral levels matter mainly when something else, such as vomiting, diarrhea, a diuretic or kidney disease, has pushed them out of range.
- 02A cramp at rest is not the same as calf pain when walking
A cramp is a sudden hard knot, usually at night, that eases when you stretch it. Aching or cramping in the calf that comes on every time you walk a certain distance and eases when you stop is claudication, the main sign of narrowed leg arteries, and needs a doctor.
A muscle cramp is a sudden, painful tightening of a muscle, most often the calf, that you can feel as a hard knot; it usually lasts from a few seconds to 10 minutes and can leave the muscle sore for a day. 3 Most night-time leg cramps have no single cause: they become more common with age and are probably driven by tired muscles and nerves firing too much, not by low minerals. 1 Hard exercise, especially in heat, late pregnancy and medicines such as statins and diuretics are the common triggers, and artery disease in the legs, nerve damage, kidney failure, cirrhosis and an underactive thyroid are the medical causes worth checking. 123
When to get help now
Ordinary cramps are painful but harmless. These signs are the exceptions.
- Severe muscle pain or weakness with dark, red or cola-colored urine, or much less urine, especially after hard exercise, heat or a new medicine 6
- A swollen leg with sudden shortness of breath, chest pain or coughing up blood 11
- Cramps or stiffness with confusion, a very high temperature or collapse in the heat
- One leg that is swollen, warm, red or painful, which can be a blood clot 11
- Cramps with numbness or swelling in the legs 3
- Cramps that last longer than 10 minutes, or keep disturbing your sleep 3
- Calf, thigh or buttock pain that comes on with walking and goes away with rest 7
- New muscle weakness, or aching muscles since starting a statin 1
LifeFrom can't examine you or assess a symptom. If something feels seriously wrong, trust that and get care rather than waiting on a test.
What a cramp is, and what is normal
Cramps are common. The 2012 American Family Physician review puts night-time leg cramps at 50 to 60% of adults and about 7% of children, notes they are slightly more common in women and rise with age, and says up to 20% of people who get them have daily cramps bad enough to see a doctor. 1 The NHS describes a cramp as a leg muscle that "tightens and causes a sudden pain that can make it hard to move," and notes the muscle may feel sore for up to 24 hours after. 3
The distinction most people get wrong is the cause. The common belief is that cramps mean you're short of water, potassium or magnesium. The American Family Physician review states the opposite for the usual cramps: "Neither exercise-related cramps nor nocturnal cramps have been associated with hypovolemia (caused by dehydration) or disturbances of electrolytes such as potassium, sodium, and magnesium." 1 It points to muscle fatigue and nerve dysfunction instead, and one theory is that lying with the foot pointed leaves the calf already shortened, so a stray nerve signal tips it into a cramp. 1 MedlinePlus still lists dehydration and low sodium, potassium or calcium as things that make cramps during exercise more likely, so minerals matter when something has pushed them out of range. 2
Night cramp or claudication? Which pattern is yours
Two other look-alikes are worth separating. Restless legs is an urge to move the legs with creeping or tingling feelings, uncomfortable but not painful and with no tight muscle, and it eases while you move. 1 Nerve damage brings numbness, tingling and electric-feeling pain with cramps only as a side effect; see tingling hands and feet. 1
What can cause it, most likely first
Ranked from most to least likely in adults in general. The order shifts with age, sex and history: idiopathic night cramps dominate in older adults, exercise cramps in active people, pregnancy for pregnant women, and medicines for anyone who started one recently.
- 01Age and idiopathic night cramps
"Most cases of leg cramps are idiopathic," meaning no cause is found, and they become more common with age. 1 The NHS lists ageing first among the causes. 3 These cramps are probably driven by nerves firing too much and by tired muscles rather than a deficiency, which is why they rarely need blood tests. 1
- 02Hard exercise, tired muscles and heat
Muscle fatigue is thought to be a primary cause, and in endurance athletes cramps go with exercising harder than usual. 1 The NHS says straining muscles during exercise can cause cramps, worse in hot or humid weather. 3 A change in training intensity can bring them on even in fit people. 1
- 03Not drinking enough, or heavy fluid loss
MedlinePlus and the NHS list dehydration as a cause, and MedlinePlus calls not getting enough fluids the most common cause of cramps during sport. 23 The American Family Physician review found no link between dehydration and the usual night or exercise cramps, so the evidence is mixed. 1 Vomiting, diarrhea and heavy sweating matter more, because they can also drain minerals. 2
- 04Medicines
The NHS names statins (for cholesterol) and diuretics (water pills for blood pressure) as examples. 3 The American Family Physician review lists the medicines most clearly linked with leg cramps as intravenous iron sucrose, conjugated estrogens, raloxifene, naproxen and teriparatide, plus some inhaled asthma medicines such as levalbuterol and albuterol with ipratropium. 1 Statins can also cause muscle aches and, rarely, muscle damage. 1 Don't stop a medicine on your own; ask the prescriber.
- Creatine kinase (CK)
- A high CK points to muscle damage, for example myositis linked with a statin, and a very high CK with dark urine points to rhabdomyolysis, an emergency. 16
- 05Pregnancy
Leg cramps are common in pregnancy, usually in the later stage. 3 The American Family Physician review notes it's hard to tell whether pregnancy itself or the vein changes that come with it are the cause. 1 Cochrane found trials of magnesium in pregnancy conflicting and too weak to rely on. 4
- 06Low potassium, calcium, magnesium or sodium
Low levels of sodium, potassium or calcium make muscle spasms more likely, and a clinician may check calcium, potassium and magnesium when cramps are frequent. 2 In a study of outpatient veterans, 63% of those with low potassium reported leg cramps. 1 Low levels usually have a reason, such as diuretics, vomiting, diarrhea or kidney disease, which is what the clinician looks for. See electrolytes explained.
- Potassium
- A low potassium (hypokalemia) can be linked with cramps and weakness; common reasons are diuretics, vomiting and diarrhea. 12
- Calcium
- A low calcium can make muscle spasms more likely. 2 Total calcium is read alongside albumin, because low albumin makes it look low; see the corrected calcium calculator.
- 07Narrowed leg arteries (peripheral artery disease)
Pain, aching, heaviness or cramping in the legs that comes with walking or stairs and goes away with rest is claudication, "the most common PAD symptom." 7 In outpatient veterans, 75% of those with peripheral vascular disease reported leg cramps. 1 No blood test diagnoses PAD; an ankle-brachial index does, though cholesterol and blood sugar tests check the risk factors. 1 See high cholesterol.
- 08Nerve damage from diabetes, low B12 or alcohol
Peripheral neuropathy, nerve damage in the feet and legs, is linked with leg cramps and mostly brings numbness, tingling and electric-feeling pain. 1 Diabetes, low vitamin B12, heavy alcohol use and HIV are the usual causes, and high blood sugar damages the nerves and the small vessels that feed them. 110 Lumbar spinal stenosis, a narrowing in the lower back, is linked with cramps too. 1
Can be linked with Vitamin B12 deficiency
- HbA1c
- A high HbA1c points to blood sugar that has run high over recent months, the main cause of diabetic nerve damage. 10 See prediabetes.
- Vitamin B12
- A low B12 can be linked with nerve damage that brings numbness, tingling and cramps; a borderline result is often followed up with more tests. 1
- 09Kidney failure and dialysis
The NIDDK lists muscle cramps, weakness or numbness among the symptoms as kidney function falls toward kidney failure. 9 The American Family Physician review links cramps with hemodialysis but not with earlier chronic kidney disease, and ties dialysis cramps to high phosphate. 1 See kidney function explained.
Can be linked with Chronic kidney disease
- eGFR
- A low eGFR (estimated glomerular filtration rate) points to reduced kidney filtering; cramps are most linked with kidney failure and dialysis. 19
- Creatinine
- A high creatinine points to the kidneys clearing waste more slowly; eGFR is calculated from it. 9
- 10Underactive thyroid or liver disease
MedlinePlus lists hypothyroidism (an underactive thyroid) as a trigger for cramps, and the NIDDK lists joint and muscle pain, fatigue and feeling cold among its symptoms. 28 About 60% of people with cirrhosis reportedly have leg cramps, mostly older people with advanced disease, and the NHS lists liver disease from alcohol. 13 See always cold for the other thyroid signs.
Can be linked with Hypothyroidism
- TSH
- A high TSH (thyroid stimulating hormone) points to an underactive thyroid; it is the first thyroid test. See how to read your thyroid panel.
These are things a symptom like this can be linked with, not a diagnosis. Several can sit together, and a clinician who knows your history puts them in order for you.
Why leg cramps strike at night
Leg cramps are "usually nocturnal," and the reasons are partly mechanical. 1 Lying in bed, the foot rests pointed down and the calf muscle is already at its shortest, so researchers think an uninhibited nerve signal tips it into a cramp. 1 Muscles tired from the day add to it, and the review notes that cramps can bring on real insomnia. 1 If cramps are only part of what keeps you up, see can't sleep.
Do you need blood tests for leg cramps?
For ordinary night cramps, usually not. The American Family Physician review's first key recommendation is that "routine laboratory tests, such as electrolyte levels, are unnecessary," and that the history should be used to diagnose them. 1 Tests earn their place when cramps are frequent, severe or new, come with other symptoms, or start with a new medicine. Then MedlinePlus lists calcium, potassium and magnesium, kidney function and thyroid function as the checks. 2 A clinician will also ask about vomiting, diarrhea, heavy sweating, alcohol and exercise. 2
| Pattern | What it can point to | What checks it |
|---|---|---|
| Night calf cramps, older adult, otherwise well | Idiopathic cramps 1 | History; usually no tests 1 |
| Cramps during or right after hard exercise | Muscle fatigue, heat, fluid and salt loss 12 | History; sodium if heavy sweating 2 |
| Cramps after starting a medicine | Medicine side effect 13 | Medicine review; CK if muscles ache 1 |
| Cramps with vomiting, diarrhea or a diuretic | Low potassium, magnesium or sodium 2 | Electrolyte panel 2 |
| Calf pain on walking, eased by rest | Peripheral artery disease 7 | Ankle-brachial index 1 |
| Cramps with numbness or tingling | Nerve damage 1 | HbA1c, vitamin B12 110 |
| Cramps with fatigue, feeling cold, weight gain | Underactive thyroid 8 | TSH 2 |
| Muscle pain with dark urine | Rhabdomyolysis (emergency) 6 | CK, kidney tests, urine tests 6 |
The panel that checks these
If a clinician tests, potassium, calcium and magnesium come first with eGFR and creatinine for the kidneys, then TSH; HbA1c and B12 follow when there is numbness or tingling, and CK when muscles ache after a new medicine or hard exercise. None of these needs fasting. Mention hard exercise in the days before, since severe exertion can raise CK on its own. 6
- Creatine kinase (CK)Medicines
- PotassiumLow potassium, calcium, magnesium or sodium
- CalciumLow potassium, calcium, magnesium or sodium
- MagnesiumLow potassium, calcium, magnesium or sodium
- SodiumLow potassium, calcium, magnesium or sodium
- HbA1cNerve damage from diabetes, low B12 or alcohol
- Vitamin B12Nerve damage from diabetes, low B12 or alcohol
- eGFRKidney failure and dialysis
- CreatinineKidney failure and dialysis
- TSHUnderactive thyroid or liver disease
LifeFrom doesn't sell blood tests. It reads results from any lab and helps you prepare for your own doctor; it doesn't diagnose.
Getting a useful test
- Note when cramps happen, which muscle, how long they last and what stops them; the history is what clinicians rely on. 1
- List every medicine with its start date, including statins, diuretics, asthma inhalers, raloxifene and hormone treatments. 13
- Mention vomiting, diarrhea, heavy sweating or heavy drinking. 2
- Mention numbness, swelling, or calf pain that comes on with walking. 37
- One result is a snapshot; see why trends beat single readings.
Quinine and magnesium: what the evidence says
Quinine was once the standard pill for night cramps. In the US the FDA's boxed warning on quinine sulfate says that using it for night-time leg cramps "may result in serious and life-threatening hematologic reactions," meaning dangerous blood problems such as a very low platelet count, and that the risk "outweighs any potential benefit." 5 The American Family Physician review agrees: "Quinine should not be used to treat nocturnal leg cramps." 1 The NHS still lists quinine as something a UK doctor may weigh when stretching hasn't helped, with a discussion of risks. 3
It is unlikely that magnesium supplementation provides clinically meaningful cramp prophylaxis to older adults experiencing skeletal muscle cramps.
Magnesium is the most marketed supplement for cramps. The 2020 Cochrane review pooled five trials in 271 older adults and found it unlikely to help, while five trials in pregnancy gave conflicting results and none tested people who cramp while exercising. 4 Mild stomach upsets such as diarrhea were the main side effect. 4 Magnesium matters when a blood test shows it is low; for ordinary cramps the evidence doesn't support it.
What may help
Stretching is the one everyday step with support for night cramps, and the rest are sensible ways to cut the triggers.
Start with the everyday things- Do a calf stretch: face a wall, lean in with your feet flat until the calves stretch, hold a few seconds and repeat for 5 minutes, 3 times a day, the last just before bed. 3
- During a cramp, stretch and massage the muscle, or stand and put weight on the leg. 3
- Exercise within your ability and build up gradually, especially in hot or humid weather. 23
- Drink enough fluids when exercising or in heat; MedlinePlus notes that after heavy sweating water alone may not be enough, since minerals are lost too. If you have heart or kidney disease or watch your salt, check with your clinician first. 2
- Ask the prescriber about any medicine that started around when the cramps did. 3
No supplement is listed. A Cochrane review found magnesium unlikely to help older adults with ordinary cramps, and quinine is not a supplement and carries an FDA boxed warning for this use. 45 Supplements support general wellness. They don't treat the causes above, and if a test finds one, treating that comes first. If you take medicines, are pregnant or have a health condition, check with your clinician before starting anything.
Questions to ask your clinician
- Could any of my medicines be causing the cramps?
- Do my cramps need any tests, and if so, which: electrolytes, kidney, thyroid, HbA1c, B12 or CK?
- Is my calf pain on walking a sign of artery disease, and should I have an ankle-brachial index?
- Could nerve damage or my back be part of this?
- Which signs would mean I should come back sooner?
This page is general education, not medical advice or a diagnosis. Cramps often have more than one contributor, and the clinician who knows your history and examines you is the one to read your results and decide what matters.
Citations
- Allen RE, Kirby KA. Nocturnal leg cramps. Am Fam Physician. 2012;86(4):350-355.
- MedlinePlus Medical Encyclopedia. Muscle cramps. US National Library of Medicine.
- NHS. Leg cramps.
- Garrison SR, Korownyk CS, Kolber MR, et al. Magnesium for skeletal muscle cramps. Cochrane Database Syst Rev. 2020;9:CD009402.
- US Food and Drug Administration. Qualaquin (quinine sulfate) prescribing information, boxed warning. DailyMed, US National Library of Medicine.
- MedlinePlus Medical Encyclopedia. Rhabdomyolysis. US National Library of Medicine.
- National Heart, Lung, and Blood Institute (NHLBI). Peripheral artery disease: symptoms.
- National Institute of Diabetes and Digestive and Kidney Diseases (NIDDK). Hypothyroidism (underactive thyroid).
- National Institute of Diabetes and Digestive and Kidney Diseases (NIDDK). What is kidney failure?
- National Institute of Diabetes and Digestive and Kidney Diseases (NIDDK). Peripheral neuropathy.
- Centers for Disease Control and Prevention. About venous thromboembolism (blood clots).
Educational context only, not medical advice or a diagnosis. Always discuss your results with a clinician.





