Do you know that moment in the middle of a workout when a muscle suddenly contracts and forces you to stop dead? Muscle cramps are one of the most common complaints among athletes, whether beginners or experienced. The good news is that they are often preventable. And electrolytes are at the heart of the solution.
What exactly is a muscle cramp?
A cramp is an involuntary, sudden, and painful contraction of a muscle or group of muscles. It can last from a few seconds to several minutes and most often occurs in the calves, thighs, feet, or abdominal muscles.
During exercise, cramps generally have two main causes: neuromuscular fatigue (the nerves controlling the muscles become overactive) and electrolyte imbalance. These two mechanisms are linked and worsen each other when you are not properly hydrated.
The central role of electrolytes in muscle contraction
What electrolytes are
Electrolytes are electrically charged minerals: sodium, potassium, magnesium, calcium, and chloride. They circulate in the blood and inside cells, regulating an impressive number of biological functions, including muscle contraction.
Every time a muscle contracts, an exchange of sodium and potassium between the inside and outside of the muscle cell causes the contraction. When this balance is disrupted by sweating or insufficient hydration, the muscles become unpredictable.
Potassium: the anti-cramp mineral
Potassium is probably the electrolyte most directly linked to muscle cramps. It regulates the polarization of muscle cell membranes. A potassium deficiency (hypokalemia) very quickly leads to cramps, muscle weakness, and palpitations.
Athletes who sweat heavily can lose between 200 and 600 mg of potassium per hour. Bananas are renowned for their potassium, but with only 370 mg per 100 g, they do not always make up for the losses from an intense workout.
Magnesium: the anti-muscle-tension mineral
Magnesium is essential for muscle relaxation. After contraction, it is what allows the muscle to relax. Without sufficient magnesium, the muscle remains in a state of tension that promotes spasms and cramps.
Magnesium is involved in more than 300 enzymatic reactions in the human body, including energy production (ATP). Its deficiency is very common among athletes, particularly those who practice endurance sports.
A landmark French study (SU.VI.MAX) showed that more than 70% of adults consume less magnesium than the recommended daily intake of 375 mg. This deficiency is even more pronounced in athletes, whose exertion increases losses through sweat and urine.
Sodium: the guardian of hydration
Sodium regulates the distribution of water in cells. It is also the primary electrolyte lost in sweat (up to 1,000 mg per liter of sweat, depending on intensity and heat). Without enough sodium, the water you drink does not remain in your cells and cannot hydrate you effectively.
That's why drinking only water during prolonged exercise can paradoxically worsen cramps: you dilute the remaining electrolytes without replenishing them.
These three minerals don't only affect cramps. Our article on the seven signs of an electrolyte deficiency reviews the other warning signs.
When do cramps occur most often?
Electrolyte-related cramps most often occur in specific situations: at the end of a long session (marathon, trail run, 90-minute match), in hot and humid weather, when sweating is heavy, after a sudden change in training intensity or volume, or when the diet is low in minerals.
Dehydration of just 2% of body weight is enough to significantly increase the risk of cramps and reduce athletic performance. That's a very small margin that many athletes exceed without realizing it.
How can electrolytes help prevent cramps?
Before exercise: fuel up
Start hydrating well before putting on your trainers. In the 2 to 3 hours before an intense session, drink 400 to 600 ml of water. If the session lasts more than 60 minutes or it's hot, add a source of electrolytes: fortified water, a hydration drink, or a powdered supplement.
During exercise: don't wait until you're thirsty
Thirst is a late sign of dehydration. At this stage, the electrolyte deficit is already established. For efforts lasting more than 45 minutes, drink 150 to 200 ml every 15 to 20 minutes. For long sessions, choose a drink containing sodium, potassium, and magnesium rather than plain water alone.
After exercise: replenishing your stores
Recovery begins as soon as the session ends. Drinking promptly helps replenish lost electrolytes and reduce nighttime cramps, which are common among athletes who do not hydrate sufficiently after exercise.
Our electrolyte drink made with coconut water is formulated for recovery: it combines 300 mg of potassium, 56 mg of magnesium, and 300 mg of sodium per bottle, in a ready-to-drink format with no artificial additives.
The period immediately after exercise is particularly important. We explain what to drink and when in our guide to recovery after exercise.
Electrolyte-rich foods to include in your daily diet
Beyond sports drinks, your daily diet is the first line of defense against cramps. Here are the most valuable food sources for each key electrolyte:
For potassium: banana, avocado, sweet potato, spinach, coconut water. For magnesium: Brazil nuts, pumpkin seeds, dark chocolate, legumes, whole grains. For sodium: unrefined sea salt (in moderation), olives, aged cheeses.
A varied, plant-rich diet covers most electrolyte needs at rest. But during and after exercise, losses through sweating require active replenishment, especially in summer or during intense workouts.
What to do immediately when a cramp occurs
When a cramp occurs, the first thing to do is gently stretch the affected muscle: for a calf cramp, flex your foot toward you by pulling on your toes. Gently massage the area to promote blood circulation. If the pain persists, a hot-water bottle may help relax the muscle. After the episode, hydrate and plan to replenish your electrolytes for the rest of the day.
If you prefer a pre-dosed solution to adjusting your diet, our electrolyte powder provides 56 mg of magnesium and 300 mg of potassium per stick, with no sugar. Our electrolyte drink guide explains when this is warranted, and drinkscore.info compares the actual contents of brands on the market.
FAQ: your questions about cramps and electrolytes
Why do I get cramps at night after exercising?
Post-exercise nighttime cramps are often a sign of an uncorrected magnesium and potassium deficiency after the session. The body continues to eliminate electrolytes for several hours after exercise, and if reserves are not replenished, the muscles contract uncontrollably at night. Proper post-session hydration and a mineral-rich dinner significantly reduce this phenomenon.
Is drinking more water enough to prevent cramps?
No. Drinking only water during prolonged exercise may even worsen electrolyte imbalances by diluting the sodium in the blood. This is called exercise-associated hyponatremia. To effectively prevent cramps, you need to hydrate with a beverage containing electrolytes, not just water.
How much magnesium should you take to prevent cramps?
The recommended daily magnesium intake for an adult is 375 mg. Athletes may have slightly higher needs. In cases of frequent cramps, supplementing with 200 to 300 mg per day (in the form of magnesium bisglycinate, citrate, or malate, which are better absorbed than oxide or chloride forms) may help, alongside hydration appropriate for the exercise.
Can cramps have causes other than electrolyte imbalance?
Yes. Muscle fatigue, neurological disorders, nerve compression, or certain medications can also cause cramps. If they occur very frequently, are severe, or happen at rest outside any sporting context, it is advisable to speak with a doctor.
Is there a difference between a cramp and muscle soreness?
Yes, completely. A cramp is a sudden, involuntary contraction that often occurs during or just after exercise. Muscle soreness is a diffuse muscle pain that appears 24 to 48 hours after exercise, caused by microscopic tears in the muscle fibers. Both can be reduced with proper hydration and electrolyte intake, but their mechanisms are different.
In summary
Muscle cramps are not an inevitable part of being an athlete. In most cases, they signal an electrolyte imbalance that can be prevented with an appropriate hydration strategy before, during, and after exercise. Sodium, potassium, and magnesium are your best allies for keeping your muscles in good shape, session after session.



