Several foods can help with cramps, whether you’re dealing with muscle cramps after exercise or painful period cramps. The common thread is minerals like magnesium and potassium, which regulate how muscles contract and relax, along with anti-inflammatory compounds that reduce the hormonal triggers behind menstrual pain. Here’s what to eat and why it works.
Magnesium-Rich Foods for Muscle Relaxation
Magnesium plays a direct role in allowing muscles to relax after they contract. When your levels are low, muscles are more likely to seize up and cramp. This makes magnesium-rich foods one of the most reliable dietary strategies for both muscle cramps and menstrual cramps, since uterine cramping is itself a form of muscle contraction.
Some of the best sources include black beans (120 milligrams per cooked cup), lentils (71 milligrams per cup), and dark leafy greens like spinach, kale, and broccoli. Nuts and seeds are another easy option: an ounce of roasted almonds delivers roughly 74 milligrams of magnesium, while an ounce of toasted sunflower seeds has about 37 milligrams. Dark chocolate with at least 70% cocoa provides about 15% of your daily magnesium needs per ounce, and studies suggest eating 40 to 120 grams of dark chocolate daily during your period may help reduce pain.
Potassium-Rich Foods That Support Muscle Function
Potassium helps your muscles contract and relax properly and keeps electrical signals firing between your nerves and muscle fibers. You lose potassium through sweat, which is one reason cramps tend to strike during or after exercise.
Avocados are a standout, packing about 975 milligrams of potassium in a single fruit. Orange juice delivers nearly 500 milligrams per cup. Sweet potatoes, bananas, melons, and watermelon are all solid sources too. Salmon provides about 326 milligrams per three-ounce serving, and tomato juice gives you roughly 15% of your daily potassium needs per cup. Milk, as a natural source of electrolytes, also contributes potassium alongside calcium.
One important caveat about bananas: while they’re the most famous “cramp food,” eating one right before exercise is unlikely to prevent cramps if your potassium levels are already normal. Bananas work best as part of a consistently potassium-rich diet rather than a last-minute fix.
Anti-Inflammatory Foods for Period Cramps
Menstrual cramps are driven by hormone-like molecules called prostaglandins, which cause the uterus to contract and shed its lining. Higher prostaglandin levels mean stronger, more painful contractions. Foods that reduce inflammation can lower prostaglandin production and ease this cycle of pain.
Fatty fish like salmon, mackerel, tuna, and trout are among the most effective options. The omega-3 fatty acids in fish directly interfere with prostaglandin metabolism. One study found a marked reduction in menstrual pain intensity after three months of regularly consuming omega-3s. These same fish are also high in vitamin D, which helps reduce the inflammatory factors in the uterus that trigger cramping in the first place. Other vitamin D sources include egg yolks, cheese, and beef liver, though the amounts are smaller.
Ginger has solid clinical evidence behind it. In a five-day study of 120 women, taking 500 milligrams of ginger root powder three times daily reduced both the intensity and duration of menstrual pain. You can get this through fresh ginger in cooking, ginger tea, or ginger supplements.
Watermelon for Exercise-Related Soreness
Watermelon contains an amino acid called L-citrulline that improves oxygen delivery to muscle tissue, speeding up repair and recovery. Spanish researchers found that athletes who drank about two cups of watermelon juice before a workout experienced less muscle soreness afterward. While this research focused on soreness rather than acute cramping, the improved blood flow to muscles addresses one of the underlying causes of exercise cramps. Watermelon is also high in potassium and water content, both of which help maintain the fluid and electrolyte balance your muscles need.
Pickle Juice for Acute Cramps
If you’re looking for something that works fast during an active cramp, pickle juice is surprisingly effective. Researchers found that drinking a small amount (roughly 2 to 3 ounces for an average adult) shortened cramp duration by about 49 seconds compared to drinking water. The relief kicks in within about 35 seconds, which is far too fast for the body to actually absorb any nutrients. Instead, the strong vinegar taste triggers a reflex in the mouth and throat that sends a signal to the nervous system, telling the cramping muscle to relax. This makes pickle juice one of the few foods that works as an immediate remedy rather than a preventive strategy.
Building a Cramp-Resistant Diet
The most effective approach combines several of these foods rather than relying on any single one. For everyday cramp prevention, aim for consistent intake of magnesium and potassium through leafy greens, legumes, nuts, and fruits like avocados and bananas. If you’re prone to exercise cramps, drink watermelon juice before workouts and keep pickle juice on hand for emergencies.
For menstrual cramps specifically, increasing your intake of fatty fish and ginger in the days leading up to and during your period targets the inflammatory process behind the pain. Adding a square or two of dark chocolate (70% cocoa or higher) gives you both magnesium and a genuinely pleasant way to manage symptoms. The key is consistency: most of these foods work best when they’re a regular part of your diet, not a one-time fix when cramps have already started.

