Leg cramps are involuntary, localised, and painful skeletal muscle contractions. They originate in the peripheral nerves. They generally occur night and only last seconds to minutes.
Approximately 7.3% of children complain of new onset nocturnal leg cramps each year., and around one third of the general population experience rest cramps, with 83% occurring in the leg and 73% occurring at night.  It is more common with increasing age with half of patients older than 64 years having leg cramps. Risk factors other than age include sport participation, hepatic cirrhosis, venous insufficiency, female gender, arthritis, and peripheral vascular disease.
- Exercise-associated muscle fatigue.
- Medications - diuretics (especially thiazide and potassium-sparing diuretics), some anti-inflammatories (e.g. naproxen), long-acting beta-2 agonists, statins, opioids, raloxifene (used in osteoporosis) and lithium.
- Alcohol consumption (OR 6.5)
- Peripheral vascular disease.
- Venous insufficiency.
- Uremia, end-stage renal disease.
- Hypokalemia, hypomagnesemia, hypocalcemia.
- Thyroid disease.
- Adrenal insufficiency.
Exercise-associated muscle cramps are due to altered neuromuscular control from muscular fatigue.  Nociceptive stimulation of myofascial trigger points has been shown to induce muscle cramps. Hypokalemia and hyponatremia lead to muscle pain because of dysfunction of the Na+/K+/ATPase pump, which leads to sustained contraction of muscle fibers. Hypocalcemia causes increased excitation of nerve and muscle cells, causing cramping and even tetany. Hypomagnesemia impairs parathyroid hormone secretion with consequent hypocalcemia, which leads to cramps as described above.
- Myalgia - Muscle pain without contraction
- Occupational contraction - Agonist and antagonist muscles fire simultaneously; eg, writer's cramp
- Claudication - Abnormal circulation, abnormal Ankle Brachial Index
- Lower motor neuron disorders such amyotrophic lateral sclerosis or postpolio syndrome - Muscle wasting and weakness with abnormal electromyelogram result
- Restless leg syndrome - Unpleasant sensation in limbs requiring voluntary movement to relieve symptoms
- Muscle contractures - Occurs only during exercise, not after; specific for muscle glycolytic metabolism disorders
Leg cramps are characterized by the acute, rapid onset of muscle spasms, accompanied by pain. A systematic review found that the most common diagnostic characteristics of leg cramps included intense pain, duration from seconds to 10 minutes, pain in the calf or foot, persistent pain after the cramp, and sleep disruption and stress.  Patients may have recently engaged in higher levels of physical activity or have a recent history of dehydration or acute volume depletion due to perspiration, diarrhea, vomiting, or diuretic use. If weakness is present, consider an underlying metabolic or neurologic disorder. If leg swelling or induration is present, consider an underlying infection, trauma, or ischemia. Many medications have been reported to cause cramps including corticosteroids, beta-agonists, beta-blockers, lithium, diuretics, statins, raloxifene, risedronate, donepezil, tolcapone, nifedipine, and albuterol. However, in a cross-sectional study of 365 elderly patients, no causal association was found for any class of drug, including diuretics. Approximately two thirds of patients about to undergo hemodialysis and approximately 80% of patients on long-term hemodialysis complain of muscle cramps. 
Laboratory testing is generally used to identify the presence of metabolic causes of muscle cramps: electrolytes, calcium, magnesium, and renal function. In athletes, no measurable electrolyte or fluid status has been shown to cause exercise-associated muscle cramps.  In patients on dialysis, those with hyperphosphatemia were more likely to have cramps (odds ratio [OR] = 1.2; 95% CI, 1.1-1.5), while those with low parathyroid hormone levels were less likely to have cramps (OR = 0.8; 0.6-0.9). If the leg is indurated or edematous, order an ultrasound to rule out deep vein thrombosis.
Perform a thorough evaluation of medications as a potential cause. If the leg cramps are associated with increased physical exertion from baseline, they are likely exercise-associated muscle cramps. If cramping occurs along with other neurologic symptoms (eg, paresthesias, weakness) consider underlying neurologic or metabolic disorder. Perform a limited laboratory workup: electrolytes, calcium, magnesium, and renal function.
Quinine may be effective in treating leg cramps, but severe adverse reactions have been reported and most preparations have been banned by the FDA.  Patients undergoing hemodialysis should receive creatine monophosphate before dialysis sessions to decrease the frequency of leg cramps. Patients undergoing hemodialysis should have tailored dialysate sodium concentration to decrease leg cramps.  Pycnogenol decreases the frequency of nocturnal leg cramps.  Diltiazem and verapamil are effective alternatives to quinine for treating leg cramps.  B-complex vitamins are effective in treating nocturnal leg cramps in the elderly. 
In a systematic review of cross-over studies, patients who took quinine (200-300 mg at bedtime) had 3.6 fewer cramps (95% CI, 2.2-5.0) in a 4-week period than patients who took placebo; approximately 3% of the patients who took quinine experienced troublesome tinnitus. A Cochrane review found low quality evidence that quinine (200 mg to 500 mg daily) significantly reduces cramp number (by 28%) and cramp days (by 20%) and moderate quality evidence that quinine reduces cramp intensity (by 10%).  Quinine is no longer recommended due to safety concerns. In 2007 Medsafe issued a warning that the risk-benefit trade-off does not support its use, and manufacturers were required to remove leg cramps as an indication. The major concern is the risk of fatal thrombocytopaenia. Quinine-related thrombocytopaenia is considered to be idiosyncratic, and can occur immediately or after years of previous use. Other hypersensitivity reactions are haemolytic uraemic syndrome, disseminated intravascular coagulation, and acute kidney injury. The frequency of serious adverse effects is estimated to be 2-4%. Some patients use tonic water which has low doses of Quinine, however Medsafe has warned that even the low doses of quinine found in tonic water can cause severe thrombocytopaenia.
Magnesium citrate did not reduce the frequency of nocturnal leg cramps in patients with nocturnal leg cramps in the ambulatory setting in a small crossover trial. 17A Cochrane review of magnesium supplementation identified 11 studies with 735 patients. There was no difference in number or severity of cramps in populations of older adults. 35 A single well designed randomized trial of 94 patients, mean age 65 years, with nocturnal leg cramps at least 4 times during a 2 week run-in period assigned them to magnesium oxide (520 mg elemental Mg+) at bedtime or placebo. While cramps were halved in both groups, there was no difference between groups. 
- Other medications
Patients given creatine monophosphate (12 mg orally) before dialysis sessions reported decreased frequency of leg cramps from 6.2 per week to 2.6 per week, while those given placebo reported no change (P < .05). 9 In a randomized trial of 53 patients undergoing 381 hemodialysis sessions, only 1 patient who received varying sodium concentrations in the dialysate complained of muscle cramps during dialysis compared with 10 patients receiving customary dialysates (NNT = 24; 95% CI, 13-106). 14 In a small cross-over trial, patients receiving diltiazem hydrochloride 30 mg at bedtime had fewer leg cramps (0.16-5.84 fewer cramps) than when they were taking placebo (P = .04). 12 In a tiny open-label study of 8 elderly patients with leg cramps despite quinine therapy, 7 of the patients treated with verapamil (120 mg at bedtime) reported that their leg cramps had resolved after 2 weeks. 
- Alcohol cessation
Alcohol consumption is a significant risk factor for nocturnal leg cramps. Cessation of alcohol is therefore potentially a treatment option but research needs to be done to specifically answer this question.
- Complementary/Alternative Therapy
Nearly 90% of elderly hypertensive patients with nocturnal leg cramps had remission of symptoms after 3 months of taking vitamin B complex (fursultiamine 50 mg, hydroxocobalamin 250 micrograms, pyridoxal phosphate 30 mg, and riboflavin 5 mg) 3 times daily compared with patients taking placebo who reported no change in symptoms. Additionally, the severity of symptoms in the B-complex group were reduced compared with those of the placebo group (2.6 vs. 8.2 on a 10-point scale). 15 In a nonrandomized study of patients with leg cramps taking a French maritime pine bark extract Pycnogenol, 200 mg daily), the frequency of leg cramps in healthy patients went from 5 events to 1 event per week, while patients taking a placebo had no response.
A Cochrane review of non-drug therapies only found one trial eligible for inclusion. The trial looked at calf stretches and compared this to a control group taking quinine. The trial found no difference between the groups.
In a Cochrane review the authors concluded that the evidence was unclear for any of the studied interventions - oral magnesium, oral calcium, oral vitamin B or oral vitamin C. Study heterogeneity meant that a meta-analysis could not be performed. The review did not include muscle stretching, massage, relaxation, heat therapy, and dorsiflexion of the foot.
Leg cramps are a painful nuisance that is not directly associated with long-term sequelae
- Review the patient's medication list carefully as there may be a drug cause.
- Quinine has moderate evidence for effectiveness in treating leg cramps but it is not approved for use due to unfavourable risk-benefit ratio.
- Diltiazem and verapamil are alternatives medication options for treating leg cramps.
- Vitamin B complex may be effective in treating nocturnal leg cramps in the elderly.
- There is conflicting evidence for magnesium in pregnancy. It is not effective in non-pregnant populations.
- Leung et al. Nocturnal leg cramps in children: incidence and clinical characteristics. Journal of the National Medical Association 1999. 91:329-32. PMID: 10388258. Full Text.
- Naylor & Young A general population survey of rest cramps. Age and ageing 1994. 23:418-20. PMID: 7825490. DOI.
- Abdulla et al. Leg cramps in the elderly: prevalence, drug and disease associations. International journal of clinical practice 1999. 53:494-6. PMID: 10692732.
- Delacour et al. Association Between Alcohol Consumption and Nocturnal Leg Cramps in Patients Over 60 Years Old: A Case-Control Study. Annals of family medicine 2018. 16:296-301. PMID: 29987076. DOI. Full Text.
- Hutton & Nelson Stretch sensitivity of Golgi tendon organs in fatigued gastrocnemius muscle. Medicine and science in sports and exercise 1986. 18:69-74. PMID: 3959867.
- Ge et al. Induction of muscle cramps by nociceptive stimulation of latent myofascial trigger points. Experimental brain research 2008. 187:623-9. PMID: 18317742. DOI.
- Hallegraeff et al. Criteria in diagnosing nocturnal leg cramps: a systematic review. BMC family practice 2017. 18:29. PMID: 28241802. DOI. Full Text.
- Noordzij et al. Disturbed mineral metabolism is associated with muscle and skin complaints in a prospective cohort of dialysis patients. Nephrology, dialysis, transplantation : official publication of the European Dialysis and Transplant Association - European Renal Association 2007. 22:2944-9. PMID: 17597087. DOI.
- Schwellnus et al. Serum electrolyte concentrations and hydration status are not associated with exercise associated muscle cramping (EAMC) in distance runners. British journal of sports medicine 2004. 38:488-92. PMID: 15273192. DOI. Full Text.
- Man-Son-Hing et al. Quinine for nocturnal leg cramps: a meta-analysis including unpublished data. Journal of general internal medicine 1998. 13:600-6. PMID: 9754515. DOI. Full Text.
- Chang et al. Creatine monohydrate treatment alleviates muscle cramps associated with haemodialysis. Nephrology, dialysis, transplantation : official publication of the European Dialysis and Transplant Association - European Renal Association 2002. 17:1978-81. PMID: 12401856. DOI.
- Meira et al. Influence of sodium profile in preventing complications during hemodialysis. Hemodialysis international. International Symposium on Home Hemodialysis 2007. 11 Suppl 3:S29-32. PMID: 17897108. DOI.
- Vinciguerra et al. Cramps and muscular pain: prevention with pycnogenol in normal subjects, venous patients, athletes, claudicants and in diabetic microangiopathy. Angiology 2006. 57:331-9. PMID: 16703193. DOI.
- Voon & Sheu Diltiazem for nocturnal leg cramps. Age and ageing 2001. 30:91-2. PMID: 11322688. DOI.
- Baltodano et al. Verapamil vs quinine in recumbent nocturnal leg cramps in the elderly. Archives of internal medicine 1988. 148:1969-70. PMID: 3046538.
- Chan et al. Randomized, double-blind, placebo-controlled study of the safety and efficacy of vitamin B complex in the treatment of nocturnal leg cramps in elderly patients with hypertension. Journal of clinical pharmacology 1998. 38:1151-4. PMID: 11301568.
- El-Tawil et al. Quinine for muscle cramps. The Cochrane database of systematic reviews 2015. CD005044. PMID: 25842375. DOI.
- New Zealand Medicines and Medical Devices Safety Authority (Medsafe). Prescriber update: Quinine - not for leg cramps anymore. Medsafe; 2007. Available from: www.medsafe.govt.nz (Accessed Dec, 2012).
- Food and Drug Administration (FDA). Quinine: important warning. FDA, USA; 2006. Available from: www.fda.gov/bbs/topics/news/2006/new01521 (Accessed Dec, 2012).
- Roguin Maor et al. Effect of Magnesium Oxide Supplementation on Nocturnal Leg Cramps: A Randomized Clinical Trial. JAMA internal medicine 2017. 177:617-623. PMID: 28241153. DOI. Full Text.
- Blyton et al. Non-drug therapies for lower limb muscle cramps. The Cochrane database of systematic reviews 2012. 1:CD008496. PMID: 22258986. DOI. Full Text.
- Zhou et al. Interventions for leg cramps in pregnancy. The Cochrane database of systematic reviews 2015. CD010655. PMID: 26262909. DOI.