Medical expert of the article
New publications
Why do leg muscles cramp and what to do?
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.

Many people are familiar with the condition when an involuntary contraction of the leg muscles occurs, preventing the ability to change its position, take a step, and also causing severe acute pain. There is also a popular method for getting yourself out of this situation - pricking yourself with a pin. Even if this stops the cramp, it does not remove the question of why this happens and what is behind it.
A muscle cramp is an episodic, involuntary, painful contraction of a muscle. Muscle spasm is a more comprehensive term that refers to any involuntary contraction of a muscle. [ 1 ]
Causes leg cramps
Muscle cramps sometimes occur in healthy people, but can be a manifestation of problems hidden in the pathologies of various organs and systems. [ 2 ] Most often, this is associated with:
- metabolic disorders, including calcium metabolism (metabolism theory);
- disturbance of electrolyte concentration in blood serum (electrolyte theory);
- prolonged uncomfortable position of the legs, for example, during sleep;
- exercise-related muscle spasms;
- pregnancy;
- diseases of the endocrine system (diabetes, hypothyroidism, etc.);
- vascular pathology, varicose veins;
- neurological disorders;
- intoxication of the body (poisoning, kidney failure);
- dehydration (dehydration theory);
- extreme environmental conditions of heat or cold (environmental theory);
- hypertensive crisis.
Diseases and conditions associated with leg cramps
Below are some of the most common diseases.
Night leg cramps
Nocturnal leg cramps affect approximately 37% of the American population over the age of 60. The syndrome is also known as sleep-related leg cramps. The most common muscles to cramp are the calf muscles. Nocturnal cramps reduce the quality of sleep and the quality of life of patients. The diagnosis is relatively simple: cramps and pain in the legs at night that can be relieved by stretching the affected muscles. Conservative treatment includes deep tissue massage or stretching. Drug treatment is currently not effective. [ 3 ]
Leg cramps in pregnant women
Muscle spasms in women during pregnancy are very common, about 50%; especially in the last 3 months and at night.
The exact cause of this disorder is not fully understood. It may be related to changes in neuromuscular function, excessive weight gain, compression of peripheral nerves, insufficient blood flow to the muscles, and increased work of the lower limb muscles.
Pregnancy cramps are not associated with fetal growth problems. There seems to be a connection between nighttime leg cramps and snoring in some pregnant women. This may lead to fetal growth problems (delays) and premature birth.
There is currently no adequate treatment to reduce the incidence of seizures.
Cramp-fasciculation syndrome
Cramp-fasciculation syndrome (CFS) is a peripheral syndrome associated with increased excitability of the peripheral nervous system. This situation results in the presence of unwanted muscle spasms and/or fasciculations. Some patients may experience other symptoms such as numbness and burning sensations typical of neuropathy.
End stage renal failure
People with chronic kidney failure undergoing dialysis often suffer from muscle spasms of the lower extremities, up to 50%. The onset of cramps can occur during dialysis or at home. Cramps in patients of this type are associated with depression, deterioration in quality of life and sleep disorders. The etiology of cramps in patients undergoing hemodialysis is unclear.
One possible cause is the presence of polyneuropathy, typical in these situations, with morphological and functional changes in the peripheral nerve fibers. Kidney transplantation significantly reduces the risk of seizures.
Amyotrophic lateral sclerosis
About 95% of patients with amyotrophic lateral sclerosis (ALS) report seizures. The frequency and intensity of seizures are not related to the severity of the disease. The cause of these seizures is unknown, but they are probably related to increased excitability of neurons. Drugs that reduce seizures in these patients are mexiletine and quinine sulfate, the latter of which have serious contraindications.
Cirrhosis
Muscle spasms are common and widespread in this category of patients (88%). Electromyogram showed quite high activation of involuntary motor unit action potentials (MPA) - over 150 Hz. Peripheral nervous system behavior is not related to neural degeneration. The cause of cramps remains unclear. The occurrence of cramps varies by muscle area: neck (9%), thigh (43%), shin (70%), toe (50%), abdominal muscles (12%), and fingers (74%). No direct relationship has been established between age or specific causes that lead to cirrhosis (alcohol, infection, etc.). It is known that there is no single cause or specific treatments to avoid cramps in patients with liver cirrhosis.
Anti-myelin-associated glycoprotein antibody (anti-MAG) neuropathy
About 60% of patients have cramps, especially in the lower extremities. Most episodes occur at night or during exercise. There is currently no explanation for how cramps occur in this pathology and no therapeutic strategy.
Diabetes mellitus
In people with diabetes, the occurrence of seizures is associated with the presence of neuropathy with increased excitability of peripheral nerves. Type I diabetes has a lower percentage of seizures (about 60%) compared to type II diabetes (about 80%). In type II diabetes, nephropathy is another factor in the occurrence of seizures. Another probable cause of seizures is associated with changes in peripheral vascularization, causing episodes of ischemia and seizures.
Fibromyalgia
According to the National Rheumatic Diseases Data Bank in the United States, seizures are one of the ten comorbidities that affect patients. One of the most likely causes is hyperstimulation of the peripheral nervous system. According to recent studies, the presence of seizures and peripheral neurological changes is directly related to the severity of the disease and inversely related to the quality of life.
Risk factors
Both heavy physical exertion, which involves the same muscle groups, and a sedentary lifestyle, and wearing high-heeled shoes, contribute to the occurrence of cramps.
A serious risk factor is a deficiency of vitamins and macronutrients, mainly calcium, magnesium, and vitamin D. Taking certain medications, such as diuretics, leads to the leaching of potassium from the body, an imbalance between it and calcium, which also leads to involuntary muscle contraction.
A predisposition to hereditary degenerative disease of the nervous system plays a significant role in the occurrence of seizures.
Pathogenesis
Common muscle spasms are characterized by a painfully hard, palpable contraction with a sudden onset, sometimes preceded or accompanied by brief twitches that usually involve one muscle at a time.
The mechanism of muscle cramps is complex and ambiguous. By their nature, they can contract rhythmically, with one after another jerks (clonic) and long-term, forcing the muscles to freeze in one position for several minutes (tonic), sometimes they are of a mixed nature.
It is believed that the former are triggered by excessive excitation of the cells of the cerebral cortex, and the latter by subcortical structures.
In terms of their distribution, muscle contractions are either local, affecting one muscle, or generalized, when many muscles are involved.
While leg cramps are fairly common in older adults and almost never seen in healthy, athletic individuals, they do occur more frequently in certain clinical settings. The mechanism for this relatively familiar symptom remains unclear, although popular theories suggest that the intramuscular nerve branches become overexcitable for some reason.
In the pathogenesis of the disease, a distinction is made between convulsive reaction, convulsive syndrome and epileptic disease. An example of the first may be muscle contractions caused by high temperature in children, or insulin shock, alcohol poisoning in adults.
Convulsive syndrome is provoked by the development of pathology of the nervous system, a decrease in the threshold of seizure readiness of the brain.
Heredity plays a major role in the development of epilepsy; for this type of seizures, provoking factors are not of decisive importance.
Epidemiology
According to statistics, about 75% of all people know firsthand what cramps are. Cases of muscle contractions in children with increased excitability of the nervous system are not uncommon. Spasms occur more often in women (56%) than in men (40%). [ 4 ]
The age of elderly people in France who suffer from seizures ranges from 65 to 69 years.
There is no connection between sex and cramps. About 80% of the affected muscle area is in the calf.
Nighttime leg cramps affect about 6% of the U.S. population, with the condition appearing to be linked to heart problems and depression.
The prevalence of cramps in pregnant women in China affects the calf area, with a percentage of 32.9%. During the first trimester, it is 11.6%, the second trimester is 28.2%, and the last trimester is 50.2%. Pregnant Indian women experience cramps most often in the third trimester, especially in the calf area (64.6%).
A multicenter American study found that 46% of COPD patients suffer from muscle spasms, which appears to be the main cause of pain in this patient population.
Another multi-center American study found that 74% of cramps occur in athletes and in high ambient temperatures.
In Australia, 32% of children with Charcot-Marie-Tooth disease type 1A suffer from seizures. The phenomenon increases with age. [ 5 ]
Symptoms
When dwelling on the symptoms of muscle cramps, we will take as a basis the convulsive reaction, and not the more complex manifestation of muscle contraction. This is a condition that is short-term in nature, and although it causes us some inconvenience, it does not affect the quality of life too much.
The first signs of cramps can be observed visually, noticing a slight twitching of a separate muscle section independent of our will and desire. Another type of sensation is reduced to the expression "leg cramp" - a painful and somewhat longer condition. Their localization can be different, but most often complaints concern:
- cramps of the calf muscles of the legs - affects mainly athletes with their heavy loads, frequent injuries, training regime. After a cramp of the calf muscle, the leg may hurt for quite a long time, which requires medical intervention and treatment;
- muscle cramps in the legs at night - prolonged static position of the limb during sleep leads to slowing of blood circulation, rare manifestations do not cause concern, frequent ones require examination;
- Leg pain and cramps are symptoms of varicose veins. Pain, burning, swelling occur mainly at the end of the day or after physical exertion. Symptoms require examination and treatment, since the disease is dangerous due to the formation of blood clots;
- muscle cramps in the arms and legs - may indicate a deficiency of certain vitamins and minerals in the body, excessive coffee consumption, smoking, which lead to vascular spasms;
- Thigh muscle cramps are a very painful condition, the spasm can cramp the front and back of the thigh, the muscles simply turn into stone. It can be provoked by prolonged heavy load on the legs;
- cramps in the toes and calf muscles - may occur as a result of wearing tight shoes, hypothermia of the feet, poor blood circulation in the extremities;
- Leg muscle cramps during pregnancy - such manifestations almost always accompany the period of bearing a child and are explained by a lack of calcium, potassium, magnesium, vitamin B6 in the woman's body, since the need for them increases for the formation and development of the fetus. This is also facilitated by toxicosis, accompanied by frequent vomiting, with vomit, some of the necessary useful components are lost.
Who to contact?
Diagnostics leg cramps
The most reasonable thing to do if you have frequent cramps is to see a general practitioner who will conduct a primary diagnosis and, if necessary, refer you to a specialist.
Palpation is the first examination: a strong tension is felt under the arm, which can cover the entire muscle area or a localized node.
Among the necessary studies are a clinical blood test, which gives an idea of the general condition of the body (whether there is inflammation, anemia, etc.), a blood sugar test to detect diabetes, a biochemical blood test to assess the functionality of the liver and kidneys, a general urine test and the Nechiporenko test (kidney function).
Instrumental diagnostics may include MRI of the head, electroencephalography of the brain, ultrasound of the vessels, Doppler ultrasonography of the veins if venous insufficiency is suspected, and X-ray examination.
Electromyography is another test that may be performed to understand the pattern of motor unit discharge and diagnose neurological pathology. Echocardiography can evaluate morphological abnormalities that may cause seizures.[ 6 ],[ 7 ]
Differential diagnosis
Differential assessment is performed between all possible causes of uncontrolled muscle contractions, ranging from true muscle cramps to electromyographic muscle contractures (e.g. Brodie's disease) and cramps associated with dystrophinopathies. In addition, true muscle spasms are differentiated from muscle rigidity and muscle twitching. [ 8 ]
Treatment leg cramps
When you have leg muscle cramps, you first need to learn how to relieve them. How to do this? First aid consists of gently rubbing, massaging the hardened muscle, patting it, since with severe cramps the muscle can remain painful for several days.
Spasms can be stopped by passively stretching the muscle or activating its antagonist. To do this, stand on a cold floor, straighten up, and try to lift your toes up. Another way is to move your foot back, place it on your big toe, pressing down with your body weight. You can also pull your toe toward you while lying down.
A 2010 study found that ingestion of small amounts of pickle juice reduced muscle spasms within 35 seconds of ingestion. The rapid inhibition of electrically evoked spasms reflects a neurally mediated reflex that occurs in the oropharyngeal region and inhibits the firing of alpha motor neurons during muscle spasm.[ 9 ]
Suggesting that there is a link between dehydration-electrolyte imbalance and exercise-associated muscle cramping, the National Athletic Trainers Association (EAMC) recommends that athletes prone to muscle cramping add 0.3 to 0.7 g/L of salt to their drinks to prevent muscle cramping.[ 10 ]
Stretching, quinine, and beta-blockers have a high level of evidence (level 2 or 3) to support their use, based on human drug studies [ 11 ] and other studies. If the athlete does not have an underlying condition, the most common treatment for EAMC is stretching. [ 12 ]
Treatment of cramps is carried out in parallel with the therapy of the underlying disease. Thus, in case of varicose veins, a comprehensive approach is used, including systemic medication (with drugs aimed at combating the mechanism of pathology development), local (ointments, gels to improve blood circulation) treatment, a diet to reduce body weight if necessary, increased physical activity with the exclusion of strength sports and heavy labor.
Medicines
The treatment regimen is based on the nature of the seizures, the time of their occurrence (night or day), age, weight, and can only be developed by a doctor. The main anticonvulsants include phenobarbital, benzonal, diphenin, and chloracane can be used.
Quinine sulfate is an effective treatment for leg cramps, but its side effect profile limits its use. Other membrane-stabilizing drugs are likely equally effective in treating this condition.[ 13 ]
Phenobarbital - tablets, reduce excitation of the central nervous system, have a hypnotic effect. As a rule, the minimum dose is prescribed. For children under 6 months, it is 5 mg once, 6-12 months - 10 mg, 1-2 years - 20 mg, 3-4 years - 30 mg, 5-6 years - 40 mg, 7-9 years - 50 mg, 10-14 years - 75 mg. For older children and adults from 50 to 200 mg. The frequency of administration is 2 times a day. Side effects include dizziness, nausea, vomiting, decreased blood pressure, skin rashes. The drug is contraindicated in the 1st trimester of pregnancy, during breastfeeding, diabetes, severe liver and kidney disease, alcohol and drug addiction. [ 14 ]
Benzonal - the dose is determined by the doctor individually. For children 3-6 years old, it can be 50 mg once, 7-10 years old - 50-100 mg, 11-14 years old - 100 mg, adults - 150-200 mg. Treatment begins with one dose per day, increasing to three times after 2-3 days. The drug is not prescribed for bronchial asthma, anemia, hyperthyroidism, diabetes mellitus, renal, hepatic, heart failure, pregnant and lactating women, children under 3 years old. The use of benzonal can cause an allergic reaction, asthma attack, constipation, diarrhea, addiction to the drug.
Frequent seizures require the simultaneous administration of other medications: calcium gluconate, papaverine, belladonna extract, tranquilizers (thioridazine, diazepam).
Quinine reduces the incidence of idiopathic leg cramps compared with placebo. The addition of theophylline to quinine may reduce the incidence of nocturnal leg cramps compared with quinine alone.
There is no evidence that analgesics, antiepileptic drugs, magnesium salts, vitamin E, stretching exercises, or compression stockings reduce spasms. There is no evidence that calcium salts, sodium chloride, or multivitamin and mineral supplements reduce spasms.[ 15 ]
To reduce the tone of peripheral muscles, muscle relaxants are used, in particular, in the treatment of non-specific lower back pain, [ 16 ] for example, dantrolene, antispasmodics are effective.
For varicose veins, phlebotropic drugs are prescribed: venotonics, phleboprotectors (detralex, venoruton, escusan). [ 17 ]
Detralex - tablets reduce the extensibility of veins, improve lymphatic drainage, blood microcirculation. Take 1 pc. in the morning and evening during meals. Not recommended for children. Prescribed with caution to pregnant women. If necessary, take during breastfeeding, it is best to stop. Detralex can cause allergies. Of the side effects, the most common are skin rashes, swelling, headache, malaise, nausea, diarrhea.
For leg muscle cramps, you can use ointments that, due to their warming or cooling effect, rubbing movements, alleviate the condition. Among them are actovegin, venozol, troxevasin, heparin, diclofenac.
Venozol - cream, activates venous outflow, relieves the feeling of heaviness in the legs, increases blood circulation. Contraindicated for children under 12, pregnant women, during lactation. Apply with massaging movements to the surface of the lower extremities 2 times a day. The course of treatment is from one to three months.
Vitamins for Leg Muscle Cramps
Since one of the reasons for the occurrence of cramps is the lack of certain minerals and vitamins in the body, it is necessary to ensure that the diet includes more calcium and potassium. It is necessary to put an emphasis in the menu on legumes, cottage cheese, hard cheeses, liver, raisins, apples, dried apricots.
Periodically, it is worth taking multivitamin complexes or, as prescribed by a doctor, magnesium, calcium, and vitamin D, which promotes the absorption of the latter. However, in the course of 2017 studies, it was proven that Vitamin D does not affect pain during muscle spasms. [ 18 ]
Folic acid (vitamin B9) is effective against leg muscle cramps. During an attack, it is recommended to chew 2 tablets at once, and then take another one for a week or two.
Short-term treatment with vitamin E is safe and effective in reducing the incidence of muscle spasms.[ 19 ]
Physiotherapy treatment
One of the common physiotherapeutic methods is therapeutic exercise, massage. [ 20 ] Even without using a special complex, you need to walk on your toes, heels, inner and outer parts of your feet every day at home or at work. You can take off your shoes under the table without others noticing, wiggle your toes, pull them towards you and away from you. It won't hurt to squat, bend your leg at the knee and pull your heel to your buttock.
Foot baths with changing water temperatures and hydromassage are useful.
If pathology is detected, it is possible to use phono- and electrophoresis, electro- and shock wave therapy. [ 21 ]
Folk remedies
Folk recipes describe methods for relieving muscle spasms:
- a pinch of onion peel is poured with a glass of boiling water and infused for 20 minutes. Drink the infusion daily at night;
- for several weeks in a row, eat a tablespoon of honey on an empty stomach in the morning, washing it down with a glass of kefir;
- Two spoons of raisins are steamed overnight in 250 ml of hot water, the next day they are drunk, the berries also need to be eaten.
Herbal treatment
Of the many medicinal herbs used to reduce convulsive manifestations, tansy and fern roots are used. Their infusion is added to the water when taking a bath. I also drink chamomile tea, it relaxes and soothes. [ 22 ] An alcohol tincture is prepared from yarrow and thyme for rubbing the feet, and an ointment is made from a mixture of celandine juice and petroleum jelly, which is rubbed in for 2 weeks.
Homeopathy
There is some evidence that homeopathic treatment is more effective than placebo; however, the strength of this evidence is low due to the poor methodological quality of the trials.[ 23 ]
Cramping convulsive pains and muscle soreness after an attack are relieved by Colocynthis cucumis - the fruit of the common colocynth plant from the pumpkin family.
There is a series of anti-cramp products manufactured by Hyland's Leg Cramps in tablets and ointments. Tablets can be taken from 12 years old, 2 at a time, every 4 hours.
The same manufacturer owns Magnesia phosphorica 6X, which relaxes muscles. Children can be given 2 pellets three times a day. For prevention, 2 pieces twice is enough. For adults, the dose is 4 tablets. During an attack, up to 8 pieces can be dissolved under the tongue every 15 minutes.
Venoflebin - anticonvulsant granules. Take 8 at a time before meals at four-hour intervals, dissolving under the tongue before meals. May cause side effects in the form of allergic reactions.
Surgical treatment
Some conditions that cause leg muscle cramps may require surgical intervention. This applies to possible injuries or, for example, varicose veins, in which case they resort to phlebectomy - removal of the enlarged sections.
Complications and consequences
Cramps and spasms of the leg muscles are often the harbingers of one or another disease, so the possible consequences are associated with specific diagnoses. Sometimes, complications caused by an attack are fraught with disability.
Prevention
Preventive measures include proper nutrition, sufficient drinking regimen, periodic massage courses, and physical exercise for the legs. Prevention in healthy people may include proper warming up of muscles before physical activity and sufficient hydration of the body. For various pathologies, also characterized by the appearance of cramps, there are no generally accepted recommendations regarding the pharmacological approach. [ 24 ]
Forecast
Muscle cramps are not life-threatening, but they may be indicative of a wide range of systemic disorders. In many cases, addressing the underlying cause may result in resolution of the muscle cramps. Most muscle cramps are self-limiting and therefore do not require treatment. Patients with ongoing leg cramps should be referred to an appropriate specialist to determine the cause and treatment. The patient should also be informed that although a large number of medications are available, their effectiveness is low and unpredictable. (Level V) [ 25 ], [ 26 ], [ 27 ]
The prognosis of muscle cramps is directly dependent on the causes that caused them, the person's age, the nature of the course, the timeliness and effectiveness of treatment. Those caused by organic damage to the nervous system tend to progress and become more frequent. An unfavorable outcome is typical of generalized convulsive epileptic seizures. In less complex cases, therapeutic support ensures long-term remission.