You have stretched, hydrated, and loaded up on electrolytes. Yet halfway through a race or deep into a training session, your calf locks up like someone has flicked a switch. Sound familiar?
What you eat in the hours and days before exercise plays a bigger role in cramp prevention than most athletes realise. While the exact mechanisms behind exercise-associated muscle cramps are still debated, the research increasingly points to a combination of neuromuscular fatigue, electrolyte imbalance, and inadequate fuelling as contributing factors.
Here are ten foods that can help keep cramps at bay, each backed by the science of why it works.
1. Pickle Juice
Pickle juice has been used as a cramp remedy in sport for decades, but the science behind why it works is more interesting than most people expect. A landmark study by Miller et al. (2010) found that pickle juice relieved electrically induced muscle cramps roughly 45% faster than water. Crucially, the relief happened far too quickly to be explained by any change in blood electrolyte levels. The juice had not even left the stomach.
The proposed mechanism is neurological. The strong acetic acid and salt content activates transient receptor potential (TRP) channels in the mouth and throat, triggering an inhibitory reflex via afferent nerves that calms the overexcited motor neurons responsible for the cramp. In short, it works through your nervous system, not your bloodstream.
For athletes, this makes pickle juice uniquely useful as both a preventative measure and an in-the-moment intervention. A small shot before or during exercise can prime the neural reflex, and another at the first sign of cramping can help shut it down within seconds.
2. Bananas
The go-to cramp food, and for good reason. Bananas are one of the richest readily available sources of potassium, delivering around 422mg per medium fruit. Potassium is essential for normal muscle contraction and relaxation, and levels drop through sweat during prolonged exercise.
But bananas offer more than just potassium. They also provide easily digestible carbohydrate (around 27g per banana), which helps maintain glycogen stores during endurance activity. A 2012 study published in PLOS ONE found that bananas performed comparably to a 6% carbohydrate sports drink in sustaining performance during a 75km cycling time trial, with the added benefit of antioxidants and fibre.
The practical appeal is obvious too. They are cheap, portable, and available at almost every race aid station on the planet.
3. Sweet Potatoes
Sweet potatoes are a nutritional powerhouse for cramp prevention. A medium sweet potato provides roughly 541mg of potassium (more than a banana), 31mg of magnesium, and a solid dose of complex carbohydrate to support glycogen stores.
They also contain beta-carotene, which the body converts to vitamin A, supporting immune function during heavy training loads when the body is under stress. The complex carbohydrate content means they provide a slower, more sustained energy release compared to simple sugars, making them an excellent choice in pre-race meals one to two days before competition.
Baked, mashed, or roasted, sweet potatoes are one of the most versatile cramp-prevention foods you can build into your regular diet.
4. Salmon
Salmon earns its place through a combination of omega-3 fatty acids, high-quality protein, and a strong electrolyte profile. A 170g fillet delivers roughly 534mg of potassium, 50mg of magnesium, and around 40g of protein.
The omega-3 fatty acids (EPA and DHA) are particularly relevant for athletes. Research published in the Journal of the International Society of Sports Nutrition suggests that omega-3 supplementation can reduce exercise-induced muscle damage and inflammation, which in turn may lower the threshold for cramping during recovery sessions and back-to-back training days.
Salmon also provides vitamin D, which many UK athletes are deficient in during the winter months. Vitamin D plays a role in calcium absorption and muscle function, both of which are relevant to cramp prevention.
5. Watermelon
Watermelon is roughly 92% water, making it one of the most hydrating whole foods available. But its cramp-prevention credentials go beyond hydration. Watermelon is a natural source of L-citrulline, an amino acid that the body converts to L-arginine, which in turn supports nitric oxide production and blood flow to working muscles.
A 2013 study in the Journal of Agricultural and Food Chemistry found that L-citrulline from watermelon juice reduced muscle soreness in athletes after intense exercise. Better blood flow means better oxygen and nutrient delivery to fatigued muscles, and a lower likelihood of the neuromuscular fatigue that contributes to cramping.
A wedge or two of watermelon as a pre-training snack or recovery food is a simple, refreshing addition to any athlete's diet, particularly in warmer conditions.
6. Spinach and Leafy Greens
Dark leafy greens are among the best dietary sources of magnesium, a mineral involved in over 300 enzymatic reactions in the body, including muscle contraction and nerve signalling. A 180g serving of cooked spinach provides around 157mg of magnesium, roughly 37% of the recommended daily intake.
Magnesium deficiency is surprisingly common among athletes, particularly those training at high volumes. A review published in Nutrients (2017) noted that strenuous exercise increases magnesium requirements by 10 to 20%, and that marginal deficiency can impair exercise performance and amplify the negative effects of oxidative stress.
Whether the evidence for magnesium directly preventing exercise-associated cramps is conclusive remains debated. But ensuring adequate intake through foods like spinach, kale, and Swiss chard supports the broader neuromuscular function that keeps cramps at bay.
7. Greek Yoghurt
Greek yoghurt delivers a strong combination of calcium, potassium, and protein. A 200g serving provides roughly 200mg of calcium, 300mg of potassium, and 15 to 20g of protein depending on the brand.
Calcium is essential for the sliding filament mechanism of muscle contraction. When calcium levels are inadequate, the signalling between nerves and muscle fibres becomes less reliable, which can contribute to involuntary contractions. For athletes who train twice a day or in hot conditions, calcium losses through sweat can be significant.
Greek yoghurt also supports gut health through its probiotic content, which is increasingly recognised as relevant to athletic performance and nutrient absorption. As a pre-training snack with fruit and honey, or as part of a recovery meal, it covers multiple bases.
8. Avocado
Avocados are exceptionally rich in potassium, packing roughly 708mg per avocado, nearly twice the amount found in a banana. They also provide magnesium (58mg), healthy monounsaturated fats, and B vitamins.
The combination of potassium and magnesium makes avocado one of the most electrolyte-dense whole foods available. The healthy fat content slows digestion, which means the electrolytes are absorbed more gradually, making avocado a better choice for pre-event meals (the night before, or at breakfast) rather than immediately before exercise.
For athletes on higher-calorie training diets, avocado is an easy way to increase both electrolyte intake and caloric density without resorting to processed supplements.
9. Bone Broth
Bone broth has seen a resurgence in sports nutrition, and for good reason. A 240ml serving provides sodium, potassium, magnesium, and calcium in a warm, easily digestible format. The sodium content is particularly high, typically 300 to 500mg per serving, which makes it useful for athletes who are heavy sweaters or who train in warm conditions.
The collagen and gelatin in bone broth also support connective tissue health, which is relevant for injury-prone endurance athletes. While the direct evidence linking bone broth to cramp prevention is limited, its electrolyte profile and digestibility make it a practical option, particularly as a pre-race evening meal or post-training recovery drink.
Ironman and ultramarathon athletes often turn to broth at late aid stations when the stomach rejects everything else. Having it as a regular part of your diet means your gut is already familiar with it when you need it most.
10. Lentils
Lentils are one of the most nutrient-dense foods for athletes concerned about cramps. A 200g serving of cooked lentils delivers approximately 731mg of potassium, 71mg of magnesium, 38mg of calcium, and 18g of protein. They are also rich in iron, which supports oxygen transport to working muscles.
For plant-based athletes, lentils are particularly valuable as they cover multiple nutritional bases in a single food. The high fibre content supports sustained energy release, though this also means they are best consumed in meals the day before competition rather than immediately pre-race.
Lentil soups, dahls, and salads are easy to prepare in bulk and make excellent staples during heavy training weeks when nutrient demands are highest.
Building a Cramp-Prevention Diet
No single food will make you cramp-proof. But building a diet that consistently delivers adequate potassium, magnesium, calcium, and sodium, alongside sufficient carbohydrate for your training load, stacks the odds heavily in your favour.
A few practical principles:
Prioritise variety.
Eating the same meals every day creates gaps. Rotating through the foods on this list ensures you cover the full spectrum of minerals and nutrients involved in muscle function.
Time your nutrition to your training.
Easily digestible foods (bananas, pickle juice, watermelon) work best around training sessions. Nutrient-dense but slower-digesting foods (lentils, sweet potatoes, salmon) are better in the hours and days before.
Do not ignore sodium.
Of all the electrolytes, sodium is lost in the highest quantities through sweat, yet it is the one many athletes actively avoid. Salting your food, including electrolyte drinks in training, and using pickle juice are all simple ways to keep sodium levels topped up.
Address the neuromuscular side.
Diet alone may not prevent cramps that are driven by neuromuscular fatigue rather than electrolyte depletion. For high-intensity or late-race scenarios, having a fast-acting neural intervention alongside your nutritional strategy gives you a more complete defence.
The foods on this list are not exotic or expensive. Most of them are already in your kitchen. The difference is being deliberate about including them in your training diet, rather than reaching for them after a cramp has already struck.
PickleUp shots are Informed Sport certified, vegan, and backed by peer-reviewed research on the TRP channel neural reflex. For cramp prevention that works in seconds, not minutes.