The best thing for cramps depends on what type you’re dealing with, but across nearly all cramp types, two remedies consistently perform well: heat and anti-inflammatory pain relievers like ibuprofen or naproxen. Heat relaxes the muscle or smooth muscle tissue causing the pain, while anti-inflammatories target the chemical signals that trigger cramping in the first place. Below is a breakdown of the most effective remedies by cramp type, so you can find the right fix fast.
Period Cramps: NSAIDs and Heat
Menstrual cramps are driven by prostaglandins, hormone-like chemicals your body releases to help the uterus shed its lining. Too much prostaglandin means stronger, more painful contractions. That’s why ibuprofen and naproxen work so well for period pain: they block prostaglandin production at the source. A Cochrane review of multiple trials found that these anti-inflammatory painkillers are significantly more effective than both placebo and acetaminophen (Tylenol) for period cramps. Acetaminophen can take the edge off, but it doesn’t reduce prostaglandins the way ibuprofen and naproxen do.
For the best results, take the medication at the first sign of cramping or even slightly before your period starts, rather than waiting until pain is severe. Once prostaglandins have already flooded the tissue, it takes longer to bring them under control.
Heat works almost as well. Continuous heat patches that maintain a temperature around 39°C (about 102°F) can match the pain relief of over-the-counter painkillers, with peak effectiveness at around eight hours of use. A simple heating pad or hot water bottle on your lower abdomen does the same job. Combining heat with an anti-inflammatory often gives better relief than either alone.
Muscle Cramps During or After Exercise
Exercise-related muscle cramps were long blamed entirely on dehydration and electrolyte loss, but the science has shifted. The leading theory now focuses on neuromuscular fatigue: when a muscle is overworked, the normal feedback loop between the nerves that fire muscle contractions and the sensors that tell those contractions to stop gets disrupted. The result is an involuntary, sustained contraction. That’s why cramps tend to hit late in a workout or race, in muscles you’ve been loading hardest.
That said, heavy sweaters who lose a lot of sodium through sweat can still be more cramp-prone. Drinking a sports drink with sodium and potassium during prolonged exercise helps, especially in hot conditions. One study found that a magnesium-enriched electrolyte mix (100 mg of elemental magnesium per serving) reduced cramp incidence in half-marathon runners. The takeaway: staying hydrated matters, but plain water alone isn’t enough if you’re sweating heavily for more than an hour. You need sodium too.
When a muscle cramp hits mid-exercise, the fastest relief comes from gently stretching the cramping muscle and holding it until the spasm releases. For a calf cramp, pull your toes toward your shin. For a hamstring cramp, straighten your leg and lean forward at the hips.
The Pickle Juice Trick
Pickle juice has a real mechanism behind it, not just folklore. The vinegar (acetic acid) activates specific nerve channels in the mouth and upper digestive tract. These channels send a signal that essentially tells the overactive motor neurons causing the cramp to calm down. It’s a neural reflex, not a hydration effect, which is why a small amount (a couple of ounces) can work within minutes. Mustard, wasabi, and even cinnamon activate the same type of nerve channels, though pickle juice is the most studied.
Nighttime Leg Cramps
Nocturnal leg cramps are common in adults over 50 and often have no clear cause. They typically strike the calf or the sole of the foot, jolting you awake with a hard knot of pain that can leave soreness for hours.
The single most effective non-drug approach is a nightly stretching routine before bed. In a trial of 80 adults over 55, those who performed calf and hamstring stretches every night before sleep saw significant reductions in both the frequency and severity of their cramps over six weeks. The routine doesn’t need to be elaborate: hold a standing calf stretch (leaning into a wall with one leg extended behind you) for 30 seconds on each side, then do a seated hamstring stretch. Consistency matters more than intensity.
Magnesium supplements are widely recommended for nighttime cramps, but the evidence is underwhelming. A Cochrane review pooling data from multiple trials found that magnesium was no better than placebo for older adults with idiopathic nocturnal cramps. The average difference was less than one cramp per week compared to placebo, and it wasn’t statistically significant. For pregnant people experiencing leg cramps, the results are mixed: some small studies show benefit, others don’t. If you want to try magnesium, it’s unlikely to cause harm at standard doses, but don’t expect dramatic results.
Stomach and Intestinal Cramps
Abdominal cramps involve smooth muscle, the involuntary muscle lining your digestive tract. When this muscle spasms, you feel that familiar gripping or twisting pain. The approach here is different from skeletal muscle cramps.
Peppermint oil capsules are the only over-the-counter antispasmodic available in the U.S. They work by limiting the calcium and sodium that smooth muscle cells need to contract, directly relaxing the gut wall. Enteric-coated capsules (designed to dissolve in the intestine rather than the stomach) tend to work best for lower abdominal cramping, like the kind associated with irritable bowel syndrome. Chamomile tea has a milder version of the same calming effect on intestinal tissue and can help with less severe cramping.
Heat also helps with stomach cramps. A warm pad on your abdomen increases blood flow and relaxes smooth muscle, providing relief while you wait for other remedies to kick in. Avoiding common triggers, like large fatty meals, caffeine, or carbonated drinks, can reduce how often gut cramps happen in the first place.
TENS Units for Cramp Relief
Transcutaneous electrical nerve stimulation (TENS) uses mild electrical pulses through adhesive pads on the skin to interrupt pain signals. For menstrual cramps, high-frequency settings (50 to 120 pulses per second) at low intensity have been shown to be more effective than sham devices. Low-frequency TENS, by contrast, doesn’t appear to outperform placebo for period pain. Portable TENS units are inexpensive and reusable, making them a good option if you prefer to avoid medication or want something to combine with other treatments.
Signs a Cramp Needs Medical Attention
Most cramps are harmless, if painful. But certain patterns warrant a closer look. Cramps accompanied by leg swelling, redness, or skin changes could point to a blood clot rather than a simple muscle spasm. Cramping pain in the legs that consistently shows up during walking and disappears with rest can indicate narrowed arteries reducing blood flow. Cramps that come with noticeable muscle weakness, happen frequently despite self-care, or cause severe discomfort that doesn’t respond to the remedies above are worth bringing to a healthcare provider. These features help distinguish a benign cramp from something that needs treatment beyond stretching and ibuprofen.

