Most muscle cramps respond to a combination of hydration, mineral intake, and targeted stretching. The right approach depends on what type of cramp you’re dealing with, whether it’s a charley horse that jolts you awake at 3 a.m., exercise-related cramping, or menstrual pain. Here’s what actually works for each, and what to skip.
Stretch Before Bed to Prevent Night Cramps
Nocturnal leg cramps are among the most common types, especially for people over 50. A randomized trial found that stretching the calves and hamstrings every night before sleep reduced cramp frequency by an average of 1.2 episodes per night over six weeks. The stretches also reduced cramp severity.
The routine doesn’t need to be complicated. A standing calf stretch (leaning into a wall with one leg back, heel on the floor) held for 20 to 30 seconds on each side, paired with a seated hamstring stretch, is enough. The key is consistency: doing it every single night, right before you get into bed.
Get Enough Magnesium
Magnesium plays a direct role in muscle relaxation, and falling short of your daily needs is one of the most common nutritional contributors to cramping. The recommended daily intake is 400 to 420 mg for adult men and 310 to 320 mg for adult women. Most people don’t hit that number through diet alone.
Good food sources include spinach, pumpkin seeds, almonds, black beans, and whole grains. Your body only absorbs about 30% to 40% of the magnesium in food, so quantity matters. If you’re supplementing, the form you choose makes a difference. Magnesium citrate and magnesium glycinate are absorbed more completely than magnesium oxide. Citrate has a mild laxative effect, which can be a benefit or a nuisance depending on your digestion. Glycinate is gentler on the stomach and less likely to cause diarrhea, making it a better fit if your bowels are already regular.
B Vitamins May Help Persistent Cramps
A placebo-controlled trial in older adults with severe nocturnal leg cramps found that a B-complex supplement (containing B1, B2, B6, and B12) produced prominent remission in 86% of patients after three months. The placebo group saw no improvement. The supplement reduced cramp frequency, intensity, and duration.
This doesn’t mean everyone with cramps needs a B-complex pill. But if your cramps are frequent and persistent, especially if you’re older or take medications that deplete B vitamins (like certain blood pressure drugs or acid reducers), it’s worth checking with your doctor whether a deficiency might be involved.
Stay Ahead of Exercise Cramps
Cramps during or after intense exercise are often tied to fatigue and fluid loss, not just dehydration alone. Sweat contains sodium, and replacing water without replacing sodium can dilute your blood levels enough to contribute to cramping. Research shows that even a modest amount of sodium in a sports drink (roughly the concentration in standard electrolyte beverages) prevents the drop in blood sodium that occurs when you drink plain water during prolonged exercise.
For most recreational exercisers, a balanced electrolyte drink during sessions longer than 60 minutes is sufficient. If you’re prone to heavy sweating or exercise in the heat, salting your pre-workout meal or adding an electrolyte tab to your water bottle can help. The goal isn’t to overload on sodium. It’s to replace what you’re losing.
What to Do When a Cramp Hits
When a muscle seizes, your instinct to stretch it is correct. For a calf cramp, flex your foot upward (toes toward your shin) and hold. Walking on the affected leg can also help the muscle release. Gentle massage toward the heart encourages blood flow back into the area.
Pickle juice has gained a reputation as a fast cramp remedy, and there’s some science behind it. The acetic acid in pickle juice stimulates receptors in the mouth and throat that trigger a reflex reducing the nerve signals causing the cramp. In one study, cramp duration dropped to about 69% to 83% of what it was with water alone. You don’t need to drink much. A small mouthful is enough, and even just swishing it around your mouth appears to activate the same reflex. The effect is neurological, not nutritional, so it works faster than any electrolyte could.
Minimizing Menstrual Cramps
Menstrual cramps happen when the uterus contracts to shed its lining, driven by hormone-like compounds called prostaglandins. Anti-inflammatory pain relievers work by blocking prostaglandin production, which is why timing matters so much. Many clinical protocols start medication one to two days before the expected onset of menstruation and continue for three to five days. If you wait until pain is already severe, you’re playing catch-up against prostaglandins that have already been released.
Heat therapy performs just as well as standard pain medication for many people. A trial comparing a continuous-heat patch (maintaining about 40°C for eight hours) against ibuprofen found no significant difference in pain relief across the first 24 hours. The heat group actually reported slightly milder pain, though the gap wasn’t statistically meaningful. If you prefer to avoid medication or want to layer strategies, a heating pad on the lower abdomen is a legitimate first-line option, not just a comfort measure.
Regular exercise throughout the month also reduces menstrual cramp severity over time. Magnesium supplementation at 300 mg twice daily has been studied for related symptoms, and many people find it eases both cramping and the fatigue that accompanies their period.
What to Avoid
Quinine, the bitter compound in tonic water, was once widely prescribed for nighttime leg cramps. The FDA has explicitly warned against this use. Quinine can cause dangerous drops in platelet counts, a serious condition affecting the kidneys and blood cells, and in some cases, hospitalization or death. The agency concluded that the risks of using quinine for leg cramps outweigh any potential benefit, given the lack of evidence that it even works for this purpose. Drinking a glass of tonic water contains far less quinine than a prescription dose, but it’s not an effective cramp remedy at that concentration either.
Putting It All Together
The most effective cramp prevention combines several small habits rather than relying on a single fix. Eating magnesium-rich foods daily, staying hydrated with electrolytes during exercise, and stretching your calves and hamstrings before bed covers the three most common triggers. For menstrual cramps, starting pain relief early and using heat gets ahead of the pain cycle rather than chasing it. Keep pickle juice or a similar vinegar-based drink on hand for the occasional cramp that breaks through anyway.

