The best treatment for cramps depends on what kind you’re dealing with. Menstrual cramps respond best to anti-inflammatory pain relievers and heat. Muscle cramps in the legs or calves improve with stretching, hydration, and sometimes targeted nutrients. Stomach cramps often ease with peppermint oil or dietary changes. Here’s what works for each type, based on the strongest available evidence.
Menstrual Cramps: Pain Relievers and Heat
Anti-inflammatory pain relievers are the most effective first-line option for menstrual cramps. Naproxen sodium and ibuprofen both outperform acetaminophen (Tylenol), which doesn’t target inflammation the way anti-inflammatories do. In pooled clinical data, naproxen at 400 mg provided noticeable pain relief within 30 minutes and maintained stronger relief than both acetaminophen and ibuprofen six hours after dosing. Ibuprofen is effective too, typically taken at 400 mg every four hours as needed for menstrual pain.
The key with anti-inflammatories is timing. Taking them at the first sign of cramping, or even slightly before your period starts if you can predict it, prevents the buildup of the inflammatory compounds that cause uterine muscle contractions. Waiting until pain is severe means those compounds already have a head start.
Heat works surprisingly well alongside or instead of medication. Wearable heat patches applied to the lower abdomen significantly reduced pain severity after eight hours of continuous use in clinical trials. A simple heating pad or hot water bottle set to a comfortable temperature does the same job. If you prefer not to take medication, heat alone can be enough for mild to moderate cramps. Combining both gives you the fastest relief: the pain reliever works internally while heat relaxes the muscle tissue from outside.
TENS Units for Menstrual Pain
Transcutaneous electrical nerve stimulation (TENS) is a lesser-known option that uses mild electrical pulses through sticky pads placed on the skin near the pain site. High-frequency TENS, delivering pulses at 50 to 120 Hz, appears more effective than placebo for menstrual cramp relief. It’s not a replacement for medication in severe cases, but it’s drug-free and reusable, which makes it worth trying if you deal with cramps monthly and want to reduce how much medication you take.
Leg and Muscle Cramps
Sudden muscle cramps in the calves, feet, or thighs are a different problem entirely. They involve skeletal muscle locking into a painful contraction, often at night or during exercise. The immediate fix is stretching the affected muscle. For a calf cramp, flex your foot upward (toes toward your shin) and hold until the spasm releases. For a thigh cramp, pull your foot toward your glute to stretch the front, or straighten the leg fully if it’s the back of the thigh.
For prevention, regular stretching of the calves and hamstrings before bed reduces how often nocturnal cramps strike. Gentle walking for a few minutes before sleep can also help by keeping the muscles from tightening up as you transition to rest.
Does Magnesium Actually Help?
Magnesium is one of the most commonly recommended supplements for leg cramps, but the evidence is weaker than most people assume. A meta-analysis reviewed by the American Academy of Family Physicians found that magnesium supplementation reduced cramp frequency by only about 10% more than placebo after four weeks, a difference that wasn’t statistically meaningful. At 12 weeks, the reduction was around 12% compared to placebo, still not a reliable effect. Magnesium may help if you’re genuinely deficient, but for most people with occasional leg cramps, it’s unlikely to be transformative.
Electrolytes and Hydration
The “you’re just dehydrated” explanation for muscle cramps is also more complicated than it sounds. Research published in the British Journal of Sports Medicine found that ultra-distance runners who experienced cramps during a race did not have clinically meaningful differences in hydration status compared to runners who didn’t cramp. Their sodium levels were slightly lower on average, but not low enough to explain the cramping. Current thinking points more toward nerve fatigue and overexertion as the primary trigger for exercise-related cramps, not simple dehydration.
That said, staying well-hydrated and maintaining electrolyte intake is still good practice for overall muscle function. It just isn’t the magic bullet for cramps that it’s often made out to be.
The Pickle Juice Trick
Pickle juice has a reputation among athletes for stopping cramps fast, and there’s a real mechanism behind it. The acid in the brine triggers nerves in the back of the throat, which sends a signal through the nervous system that essentially tells the cramping muscle to relax. It’s not about the sodium content being absorbed (that would take much longer). It’s a reflex response. A small sip is enough. Mustard works through a similar mechanism. This is most useful for exercise-induced cramps that hit suddenly during or after activity.
Stomach and Abdominal Cramps
Cramping in the abdomen often involves smooth muscle in the digestive tract rather than the skeletal muscles you consciously control. The causes range from gas and bloating to irritable bowel syndrome (IBS) to food intolerances.
Peppermint oil capsules are one of the best-studied remedies for recurring abdominal cramps, particularly in people with IBS. The active ingredient relaxes the smooth muscle of the gut by blocking calcium channels that trigger contractions. In one trial, patients taking peppermint oil capsules three times daily for eight weeks had significantly less abdominal pain and discomfort than those on placebo. Another study found that for every three IBS patients treated with peppermint oil for four weeks, one additional patient experienced at least a 50% reduction in symptoms compared to placebo. Look for enteric-coated capsules, which dissolve in the intestine rather than the stomach, reducing the chance of heartburn.
For occasional stomach cramps not tied to IBS, heat on the abdomen can help relax the smooth muscle. Avoiding trigger foods, eating smaller meals, and not lying down immediately after eating are simple changes that reduce how often cramps occur.
Vitamin D and Recurring Cramps
If you deal with frequent muscle cramps or spasms that don’t seem tied to exercise or your period, low vitamin D is worth investigating. Vitamin D deficiency (blood levels below 20 ng/mL) and insufficiency (below 30 ng/mL) have been linked to worsening muscle spasms and chronic pain, particularly in the neck and back. Case series data shows that correcting the deficiency can reduce the frequency and intensity of these episodes. A simple blood test can check your levels, and it’s especially worth considering if you live in a northern climate, spend little time outdoors, or have darker skin.
Quick Comparison by Cramp Type
- Menstrual cramps: Anti-inflammatory pain relievers (naproxen or ibuprofen) taken early, heat on the lower abdomen, or both together for the strongest relief.
- Nighttime leg cramps: Immediate stretching to break the spasm, regular calf stretches before bed for prevention. Magnesium and extra fluids have limited evidence but low risk.
- Exercise-induced cramps: Pickle juice or mustard for quick relief via the nerve reflex. Pacing your effort and building endurance gradually helps prevent them.
- Stomach and gut cramps: Enteric-coated peppermint oil capsules for recurring episodes, heat and dietary changes for occasional flare-ups.

