10 Foods That Help With Muscle Cramps (and What the Research Really Shows)

10 Foods That Help With Muscle Cramps (and What the Research Really Shows)

By Alexandria “Alix” Best, founder and head coach of The Swole Kitchen · Certified Nutritionist · B.S. Public Health · Precision Nutrition certified

A calf cramp wakes you up at 2 a.m. Your hamstring locks up halfway through a hard set. You have heard that bananas, pickle juice or magnesium will fix it, and you want to know which foods actually help.

Here is the honest answer: the link between muscle cramps and specific nutrients is weaker than most articles suggest. Eating enough electrolyte-rich food and staying hydrated is good for you and may help some people, but most cramps are not caused by a single missing mineral. Below are 10 foods worth eating, what the research does and does not show, and when a cramp is a reason to see your doctor.

Key takeaways

  • Most cramps have no single clear cause. Muscle fatigue, overuse, heat, heavy sweating and staying in one position are common triggers.
  • The evidence for nutrients is limited. Magnesium supplements are unlikely to prevent leg cramps in older adults, according to a Cochrane review.
  • Electrolyte-rich foods still matter. Potassium, magnesium, calcium and sodium support normal muscle and nerve function, and a varied diet is the best way to cover them.
  • Pickle juice may stop a cramp faster, but probably through a reflex in the mouth and throat, not by restoring electrolytes.
  • See a doctor if cramps are severe, frequent, come with weakness or swelling, or do not improve with self-care.

What causes muscle cramps?

A muscle cramp is a sudden, involuntary tightening of a muscle that does not relax on its own. Calves, hamstrings, quads and feet are the most common spots. Often no specific cause is found. Common triggers include:

  • Overusing or straining a muscle, especially when you are tired
  • Losing fluid through heavy sweating, especially in hot weather
  • Staying in one position for a long time
  • Training harder or longer than your current fitness supports

Less often, cramps are linked to low potassium, calcium or magnesium, reduced blood flow to the legs, pressure on spinal nerves, pregnancy, some medications such as certain diuretics, or conditions such as diabetes, nerve disorders, and liver or thyroid disease.

Dehydration and electrolytes: what the research shows

The popular explanation for cramps during exercise is dehydration and electrolyte loss. A review in the British Journal of Sports Medicine found that idea is weakly supported, relying mainly on anecdotes and small case series. The better-supported explanation is altered neuromuscular control: when a muscle gets fatigued, the signals that tell it to contract and relax get out of balance.

That does not mean fluids and electrolytes are irrelevant. Heavy sweating in the heat is still a risk factor, and staying hydrated is basic good practice. It means that eating a banana is unlikely to fix a cramp caused by fatigue.

10 foods that may help with muscle cramps

These foods supply potassium, magnesium, calcium, sodium or fluid. They will not guarantee you never cramp, but they help you meet your daily mineral needs, which supports normal muscle function. Adults need about 2,600 mg (women) to 3,400 mg (men) of potassium a day, and about 310–420 mg of magnesium.

Food Serving Key mineral
Lentils, cooked 1 cup 731 mg potassium
Potato, baked, flesh only 1 medium 610 mg potassium
Banana 1 medium 422 mg potassium, 32 mg magnesium
Spinach, raw 2 cups 334 mg potassium
Spinach, boiled 1/2 cup 78 mg magnesium
Salmon, Atlantic, farmed, cooked 3 oz 326 mg potassium
Greek yogurt, plain, nonfat 6 oz 240 mg potassium
Pumpkin seeds, roasted 1 oz 156 mg magnesium
Almonds, dry roasted 1 oz 80 mg magnesium
Black beans, cooked 1/2 cup 60 mg magnesium

1. Leafy greens

Spinach, kale, chard and other leafy greens provide potassium, magnesium and calcium, plus fiber. Half a cup of boiled spinach has about 78 mg of magnesium. Add a big handful to eggs, smoothies, pasta or salads.

Leafy green vegetables

2. Bananas

The classic cramp food. A medium banana has about 422 mg of potassium, which is useful but only a fraction of what you need in a day. Bananas are also easy to eat before or after training.

Bananas

3. Potatoes and sweet potatoes

A medium baked potato has about 610 mg of potassium, more than a banana. Sweet potatoes are also a good source. Both are carb sources that fit well around training.

Roasted sweet potato wedges

4. Lentils and beans

A cup of cooked lentils has about 731 mg of potassium, and half a cup of black beans has about 60 mg of magnesium. They also add protein and fiber. See more fiber-rich foods.

5. Nuts and seeds

Pumpkin seeds are one of the richest magnesium sources, at about 156 mg per ounce. Almonds and cashews provide about 74–80 mg per ounce. They are calorie-dense, so measure portions if you are watching calories.

6. Greek yogurt and milk

Dairy provides calcium and potassium, along with protein and fluid. Six ounces of plain nonfat Greek yogurt has about 240 mg of potassium. It makes an easy post-workout snack. More ideas in what to eat after a workout.

Cup of Greek yogurt

7. Salmon

A 3 oz serving of cooked farmed Atlantic salmon has about 326 mg of potassium, plus high-quality protein. It is a good example of a protein food that also helps your mineral intake.

Salmon fillets on a sheet pan with asparagus

8. Watermelon and other water-rich fruit

Watermelon, oranges, cantaloupe and berries add fluid along with some potassium. They are an easy way to support hydration in hot weather, though they are not a replacement for drinking water.

Hand holding a slice of watermelon

9. Coconut water

Coconut water naturally contains potassium and smaller amounts of sodium and magnesium. It can be a good drink after a sweaty session, but check labels for added sugar. For long or very sweaty sessions, you may need more sodium than coconut water provides.

Fresh coconut with a straw

10. Pickles, pickle juice and salty foods

Pickle juice is the one food with direct research on stopping a cramp. In a lab study, people who drank a small amount of pickle juice, about 1 mL per kg of bodyweight, had electrically induced cramps end about 49 seconds sooner than when they drank water. The researchers concluded the effect was too fast to come from restoring fluids or electrolytes. They suspected a reflex triggered in the mouth and throat. It was a small study, and the cramps were induced in a lab, not during exercise.

If you sweat heavily, especially in the heat, salty foods such as broth, pickles or salted snacks after training can help replace sodium lost in sweat. If you have high blood pressure or have been told to limit sodium, check with your doctor.

Jars of fermented vegetables and pickles

Do supplements help with muscle cramps?

The evidence is weaker than supplement marketing suggests:

  • Magnesium: a Cochrane review found magnesium supplements are unlikely to provide meaningful prevention of leg cramps in older adults. For pregnancy-related cramps, results were conflicting and the evidence was very uncertain.
  • Magnesium deficiency is uncommon in healthy people, because the kidneys limit how much is lost. It is more likely with gastrointestinal disease, type 2 diabetes, alcohol dependence and in older adults. In those cases, cramps can be a symptom, and a doctor can test for it.
  • Other supplements, including B vitamins and amino acid products, do not have strong evidence for preventing cramps in healthy, active people.

Talk to your doctor before taking mineral supplements, especially potassium or magnesium, if you have kidney disease or take medications that affect these minerals.

How to prevent and relieve muscle cramps

  1. Stretch the cramping muscle gently. For a calf cramp, straighten your leg and pull your toes toward you, or stand and press your heel to the floor.
  2. Massage the muscle and walk around once the cramp eases.
  3. Drink fluids regularly through the day and during long or hot sessions.
  4. Eat a mineral-rich diet built around the foods above, rather than relying on a single food.
  5. Build training volume gradually. Fatigue is one of the strongest triggers, so big jumps in intensity or duration raise the risk.
  6. Stretch before bed if you get night cramps, and consider a few minutes of light activity, like an easy bike ride, in the evening.
  7. Prioritize recovery and sleep. See our tips to improve recovery and get better sleep at night.

When to see a doctor about muscle cramps

Most cramps are harmless and pass in seconds to minutes. See your doctor if your cramps:

  • Cause severe discomfort
  • Come with leg swelling, redness or skin changes
  • Come with muscle weakness
  • Happen often
  • Do not get better with self-care

Also check in with your doctor if cramps started after a new medication, if you get leg pain with walking that eases when you rest, or if you have diabetes, kidney, liver or thyroid disease.

Frequently asked questions

What is the fastest way to stop a muscle cramp?

The simplest first step is to gently stretch and massage the cramping muscle until it relaxes. For a calf cramp, straighten your leg and pull your toes toward your shin. Some people also find a small sip of pickle juice helps, and one lab study found it shortened cramps by about 49 seconds compared with water, likely through a reflex.

What deficiency causes muscle cramps?

Low potassium, calcium or magnesium can cause cramps, but true deficiencies are uncommon in healthy people who eat a varied diet. Most cramps have no clear cause or are linked to muscle fatigue, overuse, heat or long periods in one position. If you get frequent cramps, a doctor can check your blood levels and review your medications.

Do bananas really help with muscle cramps?

Bananas are a good source of potassium, with about 422 mg in a medium banana, but there is little direct evidence that eating them prevents or stops cramps. Because most cramps are not caused by low potassium, a banana is a healthy snack rather than a cure. A diet with plenty of fruits, vegetables, beans and dairy supports your mineral needs better.

Does magnesium help with leg cramps at night?

For most adults, probably not. A Cochrane review found magnesium supplements are unlikely to provide meaningful prevention of leg cramps in older adults, and evidence in pregnancy is conflicting. Stretching before bed and light activity in the evening are reasonable first steps. If night cramps are frequent or severe, talk with your doctor.

Sources

This article is for education and is not medical advice. If you have frequent or severe muscle cramps, talk with your doctor.

Alexandria Alix Best

About the coach

Alexandria “Alix” Best founded The Swole Kitchen and coaches every client personally. She is a certified nutritionist with a B.S. in Public Health and Precision Nutrition certification, and has coached 1:1 nutrition and training for more than ten years. More about Alix

Back to blog