What Causes Muscle Cramps?
Why muscle cramps happen and what actually relieves them — including what the science says about the banana myth.
3 min read · Updated 2026-04-01
For informational purposes only. This content is not a substitute for professional medical advice. Always consult a qualified healthcare provider before making health decisions.
Muscle cramps — involuntary, painful muscle contractions — are extremely common and usually harmless. Here's what causes them and what to do.
Common Causes
Dehydration and electrolyte imbalance
This is one of the most common causes, particularly during or after exercise. When you sweat, you lose not just water but sodium, potassium, magnesium, and calcium — all essential for proper muscle function. Low sodium is now considered more significant than low potassium in exercise-related cramps.
Muscle fatigue
Overworked or fatigued muscles cramp more easily. This is why cramps are common during intense exercise, late in a race, or after an unusually long workout.
Poor circulation
Sitting or standing in one position for extended periods reduces blood flow and can cause cramping, particularly in the calves and feet.
Dehydration without exercise
Even without sweating, not drinking enough causes fluid and electrolyte imbalances.
Certain medications
Diuretics (used for blood pressure or heart conditions) cause electrolyte loss. Statins are associated with muscle cramps in some people. Blood pressure medications can also be culprits.
Night cramps (nocturnal leg cramps)
These often occur in the calves during sleep. More common with age, in pregnancy, and in people who sit for long periods. The exact cause isn't fully understood.
What Actually Relieves a Cramp
Stretch the muscle. For a calf cramp: pull your toes toward your shin, either actively or by standing and leaning forward. For a foot cramp: flex the foot upward and massage the arch.
Apply heat. A warm compress or heating pad relaxes the muscle.
Massage. Firm massage in the direction of the muscle fibres helps it relax.
Does Eating a Banana Actually Help?
The banana-for-cramps advice is based on potassium — but the research doesn't strongly support potassium as the primary electrolyte involved in exercise cramps. Sodium loss appears more significant.
That said, bananas do contain potassium and some magnesium, and eating one won't hurt. For prevention during exercise, drinking a sports drink with sodium is more evidence-backed than bananas.
Preventing Cramps
- Stay well hydrated before, during, and after exercise
- Include sodium in your fluid replacement during long exercise (sports drinks or salted snacks)
- Warm up and cool down properly
- Stretch regularly, particularly calves and hamstrings
- Don't exercise to the point of muscle exhaustion without adequate training progression
When to See a Doctor
Most cramps are benign. See a doctor if:
- Cramps are severe, frequent, and not exercise-related
- They're accompanied by muscle weakness, swelling, or skin changes
- Night cramps are significantly disrupting your sleep
- You're on new medications and cramps started around the same time
Blood tests can check electrolytes, kidney function, and other potential underlying causes.