💥 Muscle Cramps and Spasms: The Balance of Magnesium, Potassium, Calcium and Sodium
Why muscles cramp at night and after exercise — and which electrolytes matter most
Muscle cramps are sudden, involuntary, often painful muscle contractions. The best known are nighttime calf cramps, but spasms can occur in any muscle: feet, thighs, hands, abdomen. Causes vary, but very often the issue is an electrolyte imbalance and a lack of magnesium.
Muscles contract thanks to a flow of ions — magnesium, potassium, calcium, sodium — across cell membranes. When the balance of these minerals is disturbed, a muscle can "get stuck" in contraction, producing a cramp. Let's look at the role of each element and what to do.
What is a muscle cramp
A cramp is a sudden, usually painful, involuntary muscle contraction that does not resolve on its own for a while. The calf muscles and feet are most often affected, especially at night or after intense exercise.
The mechanism involves the excitability of the neuromuscular junction. For normal contraction and subsequent relaxation, the muscle needs ions: calcium triggers contraction, magnesium helps the muscle relax, and potassium and sodium maintain the cell's electrical potential. Disruption of any of these processes can lead to a spasm.
Magnesium: the main "relaxing" mineral
Magnesium participates in hundreds of enzymatic reactions and plays a key role in muscle and nerve function. It helps the muscle relax after contraction and stabilizes cell membranes. It is magnesium deficiency that is most often linked to cramps and spasms.
Potassium: the cell potential
Potassium is the main intracellular cation. It maintains the electrical potential of cell membranes and participates in nerve impulse transmission and muscle contraction. Potassium deficiency (hypokalemia) can cause weakness and cramps.
Calcium and sodium: contraction and water balance
Calcium is the key ion of muscle contraction: it enters the muscle cell and triggers contraction. Sodium is the main extracellular cation; it maintains fluid volume and the electrical gradient. Sodium imbalance (especially its deficiency with heavy sweating) is also linked to cramps.
Contraction
Triggers muscle contraction. With calcium imbalance, both spasms and twitching are possible.
Water and potential
Maintains fluid volume and gradient. Sodium deficiency in heat and sweating is linked to cramps.
Other causes and when to see a doctor
Not all cramps are related to electrolytes. Possible causes:
| Cause | Comment |
|---|---|
| Muscle overload | Fatigue and overuse are a common cause of night cramps |
| Dehydration | Lack of water worsens the electrolyte imbalance |
| Medications | Some diuretics, statins, blood pressure drugs |
| Diseases | Thyroid disorders, diabetes, neurological problems |
| Pregnancy | Leg cramps are common, especially in the second-third trimester |
Foods and electrolyte norms
The main way to maintain balance is a varied diet. Approximate norms and foods:
| Element | Norm/day | Foods |
|---|---|---|
| Magnesium | ~400–420 mg (men), ~310–360 mg (women) | Dark chocolate, pumpkin seeds (~262 mg/100 g), almonds, spinach |
| Potassium | ~3500 mg | Bananas, potatoes, beans, avocado, greens |
| Calcium | ~1000 mg | Dairy, sesame, leafy greens |
| Sodium | ~1500–2300 mg | Salt, but with attention to needs and blood pressure |
What to do: practical tips
A comprehensive approach to preventing cramps:
Drink enough water
Dehydration worsens spasms. Drink enough, especially in heat and during exercise.
Eat a varied diet
Vegetables, fruit, nuts, legumes and dairy provide magnesium, potassium and calcium.
Stretch before bed
Light stretching of the calf muscles may reduce the frequency of night cramps.
Don't overload muscles
Gradually increasing load and warming up reduce the risk of cramps after sport.
Consider magnesium if deficient
If tests confirm a magnesium deficiency, a supplement (preferably a well-absorbed form) may help — discuss it with your doctor.
Why do muscle cramps happen?
Because of an electrolyte imbalance (magnesium, potassium, calcium, sodium), muscle overload, dehydration, or certain medications and diseases.
Which deficiency causes cramps?
Most often a lack of magnesium and potassium, less often calcium and sodium.
Does magnesium help with cramps?
With a real magnesium deficiency, yes. But not all cramps resolve with magnesium alone — the whole picture matters.
Why do legs cramp at night?
Often because of muscle fatigue, electrolyte imbalance and dehydration. More common with age and in athletes.
Which foods are rich in magnesium?
Dark chocolate, pumpkin seeds, almonds, spinach, nuts, legumes.
How much magnesium per day?
About 400–420 mg for men and 310–360 mg for women per day.
Are cramps dangerous?
Most cramps are benign. But frequent and severe cramps are worth discussing with a doctor.
What to do during a night cramp?
Gently stretch the muscle, massage it, apply heat or cold. For prevention, stretch and drink water before bed.
Can I take potassium for cramps?
Potassium supplements are only by prescription (dangerous with kidney disease). The main source is food.
Which magnesium form is best for muscles?
Citrate, glycinate and taurate are well absorbed and gentler on the gut than magnesium oxide.