Medical expert of the article
New publications
Leg cramps: causes
Last reviewed: 04.07.2025

All iLive content is medically reviewed or fact checked to ensure as much factual accuracy as possible.
We have strict sourcing guidelines and only link to reputable media sites, academic research institutions and, whenever possible, medically peer reviewed studies. Note that the numbers in parentheses ([1], [2], etc.) are clickable links to these studies.
If you feel that any of our content is inaccurate, out-of-date, or otherwise questionable, please select it and press Ctrl + Enter.

Leg cramps occur when a skeletal muscle involuntarily contracts and tightens to its maximum in a sudden, often very painful, but short-lived spasm. The muscles most commonly affected by cramping are the calf muscles at the back of the leg, as well as the muscles of the foot, the back of the thigh above the hamstring, or the quadriceps at the front of the thigh. [ 1 ]
Epidemiology
Statistics show that almost six out of ten older adults frequently experience leg cramps, primarily at night: three out of four cases occur during sleep.
Moreover, leg cramps in men occur almost three times less frequently than cramps in women.
By some estimates, peripheral arterial disease (vascular disease of the lower extremities) affects almost 10% of people over 55 years of age.
Febrile seizures affect approximately 2-5% of children under five years of age.
Causes leg cramps
In many cases, the cause of leg cramps is unknown and is called idiopathic, according to medical experts.
Among the identified causes, the most common are excessive muscle strain and overstraining of muscle fibers in the calf or back of the thigh (hamstring area) with the development of leg cramps after training; severe leg cramps develop after running – intense painful contractions that usually occur with fatigue and/or overheating. Local cramps are observed with overstraining of individual muscle groups due to the performance of frequently repeated fast movements, which, in particular, explains leg cramps during orgasm during sex.
Muscle spasms in the lower extremities or cramps that are not associated with increased physical activity can be caused by many different reasons: night leg cramps occur due to an uncomfortable body position, cooling or overheating during sleep, or a bed that is too soft or too hard. At night, leg cramps occur more often in people over 50 than in younger people, and more often in overweight people than in thin people.
The main cause of leg cramps in the morning is considered to be a prolonged awkward position of the legs during sleep, with compression of the blood vessels.
Tonic leg cramps during the day occur when a person walks for a long time, stands on a hard surface for a long time, or is forced to sit for a long time. The feet of those who suffer from flat feet or wear shoes that are too narrow often cramp, and high heels only increase the risk of muscle spasms in the calves and feet.
Many people have leg cramps in water - in a pool or natural reservoirs. What causes leg cramps when swimming? Experts associate them with the flexion of the sole of the foot during swimming - when all the muscles of the leg form a rigid line from the shin to the toes, which allows you to move in the water. But holding this position overstrains the muscles and can cause their involuntary contraction - severe leg cramps. In addition, in cold water, due to the compression of blood vessels, the speed of blood circulation decreases, and with insufficient oxygen supply to muscle tissue, neuromuscular conduction is disrupted.
These are the most common benign types of leg cramps.
Read also – Why do toes cramp?
However, there are many conditions and pathologies in which a cramp in the left, right leg or cramps in both legs is one of their symptoms. That is, they are considered secondary, and in such cases the causes of leg cramps are associated with specific conditions or diseases.
Leg cramps after surgery are considered a side effect of pain medications used for local and general anesthesia.
Cramps from a broken leg occur when the bone traumatically damages the surrounding muscle fibers and compresses the endings of the motor nerves.
As a result of the toxic effects of ethanol on the central nervous system with inhibition of nerve signals, decreased electrolyte levels due to dehydration, and disruption of regional blood circulation, leg cramps occur after drinking alcohol (especially in chronic alcoholics). [ 2 ]
Muscle spasms in the form of cramps can occur due to iatrogenic causes: with long-term use of drugs such as selective beta-adrenergic receptor agonists (bronchodilators), SSRI antidepressants, barbiturates, lithium, statins, nicotinic acid, hormonal contraceptives, cytostatics (anti-cancer agents). After long-term use of diuretics, that is, after diuretics, leg cramps are associated with increased excretion of magnesium from the body and the development of hypomagnesemia.
Leg cramps and aching during pregnancy (especially in the later stages) are caused by a decrease in the amount of magnesium and calcium in the blood – hypocalcemia. Nighttime foot cramps are common in the third trimester of pregnancy due to the pressure of the uterus on the veins and the deterioration of blood outflow; cramps in the legs and groin often occur. For more information, see – Why do legs cramp during pregnancy. And leg cramps after childbirth are the result of compression of blood vessels and tension in the muscles of the pelvic area and thighs.
Leg cramps in a child may occur due to dehydration (due to vomiting and/or diarrhea); vitamin deficiency; problems with the thyroid gland. In febrile conditions associated with infectious diseases, leg cramps and fever are combined in children under five years of age. Such cramps are called febrile.
There is an increased risk of leg cramps due to parasites – parasitic infestations: ascariasis, trichinosis, echinococcosis.
Frequent leg cramps in the elderly can be explained by the natural shortening of the tendons (due to fluid loss) and decreased elasticity of muscle fibers; also in old age, painful cramps in the calves (at rest) and the anterior part of the tibialis muscle (after walking) can be observed, which are symptoms of idiopathic neuropathy of the legs.
In addition to physical inactivity and age-related degenerative changes in muscles, leg cramps in people over 50 occur due to impaired blood circulation in the legs. A common condition with poor blood circulation associated with atherosclerosis or venous insufficiency is leg cramps when walking with the appearance of painful sensations and even temporary lameness. In the first case, poor blood circulation in the arteries of the legs in old age often correlates with problems of atherosclerotic changes in the cerebral vessels, and the first signal of the risk of developing such a dangerous condition as ischemic stroke in the future, experts believe, is sleep disorders, persistent headaches, frequent dizziness and leg cramps.
People who complain of cramps and cold legs, as well as leg pain at rest, cramps in the evenings, should be examined for peripheral vascular disease of the legs (which develops due to cholesterol deposits in the arteries of the lower extremities).
In the second case, these are leg cramps due to varicose veins - varicose expansion of the superficial veins, which is accompanied by a deterioration in the outflow of venous blood from the legs and a violation of muscle trophism. These types of cramps usually affect the calf muscles and the quadriceps, which are stretched through two joints, that is, leg cramps are noted above the knee, thigh.
Complaints of cramps and cold feet are associated with endocrinological problems: the presence of diabetes or hypothyroidism.
If there are symptoms such as cramps and numbness in the legs (paresthesia), then there is a suspicion that this is the result of compression of the nerve endings, and the culprit may be osteochondrosis in the lumbar region with the development of radiculopathy.
Most often, such leg cramps are observed in diabetes due to neurological disorders - diabetic neuropathy. Another causal risk factor for cramps in diabetics is angiopathy of the extremities, which develops due to a decrease in the intensity of capillary and arterial blood flow in the legs.
If a patient complains of cramps and burning in the legs, this may indicate peripheral neuropathy - a violation of the transmission of nerve impulses, observed in diabetes, cancer, nutritional disorders, infectious inflammations, chemotherapy of malignant tumors. In healthy people, burning in the legs after cramps is associated with lactic acidosis, that is, the accumulation of lactic acid in the blood - a by-product of the breakdown of glucose, the breakdown of which (to obtain energy) occurs during intense training.
Leg and back cramps accompanied by numbness and tingling in the leg can be caused by an intervertebral or intervertebral hernia (as a result of degenerative changes in muscles and disturbances in their innervation). And leg cramps with a herniated disc are associated with pinched nerves or stenosis of the lumbar spine; compression of the nerve root is considered by neurologists as one of the predisposing factors for night cramps in the legs.
If, in addition to the occurrence of cramps, the legs fail, it is possible that the patient has pathologies such as multiple sclerosis (an autoimmune disease of the nervous system, in which nerve endings lose their myelin sheath and muscle function is impaired with the development of spasticity) or motor neuron disease.
Accompanied by involuntary contractions of muscle fibers - fasciculations - peripheral flaccid paresis, that is, a decrease in muscle tone in one or both legs, may indicate such neurological problems as amyotrophic lateral sclerosis or damage to the motor neurons of the spinal cord (motor neuropathy).
The list of the most likely causes of leg and arm cramps includes:
- insufficiency of the parathyroid glands - hypoparathyroidism, as a result of which the level of calcium in the blood decreases;
- chronic renal failure leading to increased phosphate levels in the blood;
- potassium deficiency;
- dehydration or lack of fluid;
- epilepsy (with tonic-clonic seizures);
- alcoholic delirium;
- anemia (iron deficiency or hemolytic);
- multiple sclerosis;
- hypoglycemia;
- infections, primary tumors or brain aneurysm;
- side effects of drugs.
Risk factors
Summarizing the etiology of leg cramps, doctors name the following risk factors for their occurrence:
- overstrain of the muscles of the lower limbs;
- sedentary lifestyle and obesity;
- musculoskeletal injuries;
- age-related degenerative changes in muscle tissue and tendons;
- dehydration, associated with both insufficient fluid intake and excessive sweating;
- alcoholism;
- flat feet, wearing unsuitable shoes;
- low levels of electrolytes (magnesium, calcium, or potassium) in the blood;
- vitamin deficiency (B6, D, E);
- pregnancy;
- high blood cholesterol;
- the presence of neurological or metabolic disorders;
- endocrine diseases (diabetes mellitus, hypothyroidism, hypoparathyroidism);
- neuromuscular disorders, in particular neuropathy, myopathy, motor neuron disease;
- compression of spinal nerves;
- liver cirrhosis;
- chronic kidney failure and the effects of renal dialysis (which removes too much fluid from the body, which disrupts the balance of electrolytes);
- Parkinson's disease, Huntington's disease;
- use of certain medications.
Older people have a higher risk of leg cramps: closer to 50 years of age, muscle loss begins, and – if a person leads a sedentary lifestyle – this process progresses.
Pathogenesis
The biochemistry of muscle contraction is very complex, and how the processes of transmission of nerve impulses are disrupted is not yet entirely clear. The mechanism of development of cramps of the lower extremities at night, that is, their pathogenesis, is explained by the fact that cramps occur when the calf muscle - when the legs are positioned in sleep with half-bent knees and feet pointing downwards - is in a shortened position and can spasm with any attempt to change position.
In addition, prolonged periods in the same position during sleep are accompanied by a slowdown in blood circulation and a decrease in oxygen levels in muscle tissue, which leads to cramps.
There are several versions of the pathogenesis of cramps during physical overexertion. Traditionally, it is believed that such spasms occur as a result of dehydration, electrolyte imbalance (including magnesium, potassium and calcium), lactic acid accumulation or low cellular energy (in the form of ATP). For example, if the body lacks magnesium, the contact of afferent and efferent neurons in neuromuscular cholinergic synapses is disrupted: presynaptic membrane channels stop opening, and this leads to an increase in the level of free acetylcholine in the synaptic cleft - a mediator of nerve impulses in muscles.
It is assumed that the mechanism of seizures is associated with increased activity of the neuromuscular reflex arc of the central nervous system, caused, on the one hand, by the inhibitory effect exerted by the Golgi tendon organs, and on the other hand, by hyperactivation of muscle spindles. [ 3 ]
Symptoms leg cramps
Leg cramps occur suddenly, but some patients claim that they can feel the first signs of cramping in the form of fasciculations - twitching of muscle fibers.
The main symptoms of a cramp are a sharp tension, i.e. a contraction of the muscle, causing pain. In this case, the muscle contracted by the cramp becomes hard (rigid), and it is impossible to relax it by an effort of will.
The leg cramp does not go away for 20-30 seconds or several minutes; the cramp in the quadriceps muscle of the thigh lasts the longest.
After the cramp passes, a nagging pain in the muscle may be felt for some time.
Cramps in diabetes affect the muscles of the legs and feet and are accompanied by paresthesia (or hyperesthesia), and quite severe pain in the leg after the cramp with the inability to move normally can be observed for several hours. [ 4 ]
Complications and consequences
In cases of leg cramps after physical activity, there are no negative health or medical consequences.
Leg cramps at night can reduce your quality of life by disrupting your sleep.
It is not difficult to guess how dangerous leg cramps are, which can happen to a person driving a car or swimming in a river...
The consequences of diseases, one of the symptoms of which are cramps of the lower extremities, have nothing to do with involuntary muscle contractions themselves. Although many of these conditions, for example, peripheral vascular disease of the legs, are
Potentially disabling.
Diagnostics leg cramps
From a medical perspective, primary benign cramps are rarely of concern, and diagnosis is required if non-exercise related involuntary muscle contractions occur repeatedly.
Necessary tests for leg cramps: general and biochemical blood tests; sugar levels, creatine kinase, lactate dehydrogenase, electrolytes, parathyroid hormone, specific antibodies to helminths.
Instrumental diagnostics are also carried out:
- muscle examination (electromyography, ultrasound);
- Dopplerography and ultrasound of leg vessels, angiography.
- MRI of the spinal cord is performed if focal muscle weakness or neurological signs are observed.
Differential diagnosis
Differential diagnosis is very important, since some disorders cause symptoms that resemble seizures: dystonia, spasticity (including myotonia), fasciculations, essential tremor, myokymia, tetany. As well as focal or partial leg cramps, which are determined in epilepsy, and clonic seizures, which are characteristic of epilepsy and hyperkinesis.
Leg cramps are different from a condition called restless legs syndrome.
Often, the exact cause of leg cramps is difficult to determine and may be caused by a combination of factors.
For example, the low-carb Kremlin diet, which, like the Atkins diet, is a keto diet, removes fluid from the body. As a result, those who adhere to this diet for weight loss (consuming a lot of proteins and fats) not only experience constipation, but also leg cramps - since the absorption of magnesium in the intestines decreases.