Leg cramps are sudden, involuntary, painful muscle contractions, and they have a long list of possible triggers. The most common causes are dehydration, muscle overuse, prolonged inactivity, and electrolyte imbalances. But cramps can also signal underlying medical conditions, medication side effects, or circulatory problems, especially if they happen frequently or wake you up at night.
Dehydration and Electrolyte Imbalances
When your body loses more fluid than it takes in, the balance of minerals in your blood shifts. Electrolytes like sodium, potassium, and magnesium are essential for muscles to contract and relax properly. If any of these drop too low, your muscles can fire erratically and lock into a painful cramp. This is why cramps often strike during hot weather, after heavy sweating, or when you haven’t been drinking enough water.
Potassium supports nerve and muscle signaling. Magnesium helps regulate the nerve impulses that tell muscles when to tighten and release. Calcium plays a role in the chemical chain reaction behind every muscle contraction. You don’t need to be severely deficient in any of these for cramps to show up. Even mild imbalances, from skipping meals, drinking alcohol, or sweating through a workout, can be enough to tip the balance.
Muscle Overuse and Fatigue
Cramps frequently hit muscles that have been overworked or pushed harder than usual. Starting a new exercise routine, ramping up intensity too quickly, or doing repetitive motions for long periods are classic triggers. This type of cramping tends to strike during or shortly after the activity, and it almost always targets the muscles you were using.
For years, the standard explanation was that exercise cramps were caused by dehydration and salt loss. More recent research challenges this view. A review in the British Journal of Sports Medicine found that four prospective studies failed to support the dehydration hypothesis and pointed out a key inconsistency: electrolyte depletion is a whole-body problem, yet exercise cramps almost always appear in one specific muscle group rather than throughout the body. The leading alternative theory focuses on neuromuscular fatigue. As a muscle tires, the nerve signals that normally prevent excessive contraction become weaker, while the signals that drive contraction become stronger. The result is a sustained, involuntary contraction: a cramp.
This helps explain why cramps tend to hit the hardest-working muscles at the end of a long run or game, not all your muscles at once.
Prolonged Sitting or Standing
You don’t need to be exercising to get leg cramps. Staying in one position for too long, whether sitting at a desk for hours or standing still on a hard floor, slows blood flow to your legs. Reduced circulation can cause muscles to tighten and eventually cramp. People who work desk jobs or stand for long shifts often notice cramps in their calves or feet, particularly later in the evening.
Why Cramps Strike at Night
Nocturnal leg cramps are especially common and can jolt you awake with a calf or foot locked in a painful knot. They tend to affect older adults more often, though anyone can get them. The exact reason cramps prefer nighttime isn’t fully understood, but several factors converge while you sleep: mild dehydration from hours without drinking, reduced circulation from lying still, and subtle foot positioning that shortens the calf muscle.
Certain medications increase the risk. Drugs that boost urine output (diuretics), blood pressure medications, cholesterol-lowering statins, and even birth control pills have all been linked to nocturnal cramps. The connection isn’t always straightforward. Diuretics, for instance, may contribute by depleting potassium and magnesium, while statins may affect the muscle tissue itself.
Medications That Can Trigger Cramps
A surprisingly long list of drugs can cause or worsen leg cramps. The major categories include:
- Diuretics (water pills), which flush electrolytes along with excess fluid
- Statins (cholesterol medications like lovastatin), which can cause muscle-related side effects
- Blood pressure medications, including certain beta-blockers and angiotensin II receptor blockers
- Bronchodilators and other drugs with stimulant-like effects on the nervous system
- Oral contraceptives
- Stimulants such as caffeine, nicotine, amphetamines, and pseudoephedrine
Withdrawal from alcohol, benzodiazepines, and sedatives can also trigger cramps. If your leg cramps started or worsened after beginning a new medication, that’s worth raising with your prescriber.
Pregnancy
Leg cramps are one of the most common physical complaints during pregnancy, particularly from the second trimester onward. Roughly 30% to 50% of women experience cramps at least twice a week during the third trimester. The causes layer on top of each other: weight gain puts extra strain on leg muscles, postural changes shift how those muscles are loaded, and hormonal shifts alter fluid and mineral balance. A buildup of lactic acid and related compounds in tired leg muscles likely contributes to the involuntary contractions. Women who have been pregnant before tend to experience cramps more frequently, possibly because repeated pregnancies amplify the physical stresses involved.
Underlying Medical Conditions
When leg cramps are frequent, severe, or don’t respond to simple fixes like stretching and hydration, a medical condition may be involved. Several categories of disease can produce chronic cramping.
Circulatory Problems
Peripheral artery disease (PAD) narrows the arteries that supply blood to your legs, usually from a buildup of fatty plaque. The hallmark symptom is called claudication: cramping pain in the legs that comes on with walking and eases with rest. The pain happens because your narrowed arteries can’t deliver enough blood to meet the muscle’s demand during activity. PAD is more common in people who smoke, have diabetes, or have high blood pressure or cholesterol.
Nerve-Related Conditions
Damage or compression of the nerves that control leg muscles can produce cramps. Peripheral neuropathy, often caused by diabetes, disrupts normal nerve signaling and can lead to cramping along with numbness and tingling. Spinal stenosis, a narrowing of the spinal canal, can compress nerves as they exit the spine and cause leg cramps that worsen with walking or standing. Parkinson’s disease also increases cramp frequency due to its effects on motor nerve control.
Metabolic and Endocrine Disorders
Thyroid disorders, both overactive and underactive, can alter the mineral balance and nerve function that muscles depend on. Diabetes (type 1 and type 2) contributes through nerve damage, circulation problems, and blood sugar fluctuations. Chronic kidney disease impairs the body’s ability to maintain proper electrolyte levels, which is why people on dialysis commonly experience cramps. Anemia, low blood sugar, and Addison’s disease (a rare adrenal gland condition) round out the metabolic causes.
Liver Disease and Alcohol Use
Cirrhosis of the liver is associated with frequent muscle cramps, likely because the damaged liver struggles to regulate minerals and fluid balance. Alcohol use disorder contributes through multiple pathways: direct nerve damage, poor nutrition, chronic dehydration, and mineral depletion.
Why Quinine Is Not the Answer
Quinine, once widely recommended for leg cramps, is no longer considered safe or effective for this purpose. The FDA has issued repeated warnings since 2006 because quinine carries serious risks, including life-threatening blood disorders, dangerous heart rhythm changes, and kidney failure requiring dialysis. Fatalities have been reported. Quinine remains approved only for treating malaria, and using it for leg cramps is considered off-label and risky given the alternatives.
Symptoms That Need Attention
Most leg cramps are harmless and resolve within a few minutes. But certain patterns suggest something more is going on. Cramps that last longer than 10 minutes without improving when you move, cramps accompanied by leg swelling or numbness, muscles that are visibly shrinking or getting weaker, and cramps frequent enough to regularly disrupt your sleep all warrant a closer look. Cramps that develop after exposure to toxic substances like lead or mercury need urgent evaluation.

