The fastest way to stop a muscle cramp is to gently stretch the affected muscle and hold it until the spasm releases. For menstrual cramps, an over-the-counter anti-inflammatory like ibuprofen or naproxen works best when taken at the first sign of pain. Beyond those immediate fixes, what helps most depends on the type of cramp you’re dealing with and how often it happens.
Stopping a Muscle Cramp in the Moment
When a cramp hits your calf, the most effective response is to straighten your leg and pull your toes toward your shin. For a thigh cramp, pull your foot behind you toward your glutes. Hold the stretch firmly but don’t bounce. The goal is to lengthen the muscle that’s locked in contraction, which signals it to relax. Walking around slowly once the worst passes can help flush out the tightness.
Heat applied to the cramping muscle can speed relief. Warmth reduces muscle spasm and increases blood flow to the area, helping clear the chemical buildup that contributes to the pain. A warm towel, heating pad, or even a hot shower directed at the muscle all work. Save ice for injuries with swelling, not for cramps.
Pickle juice is a surprisingly well-studied remedy. Research published in Medicine and Science in Sports and Exercise found that small amounts of pickle juice can relieve muscle cramps within about 35 seconds of ingestion. That’s far too fast to be explained by rehydration or electrolyte absorption. The researchers concluded that the strong vinegar taste triggers a reflex in the mouth and throat that signals the nervous system to shut down the overactive nerve firing causing the cramp. Mustard appears to work through the same mechanism, which is why athletes sometimes reach for mustard packets on the sideline.
Preventing Muscle Cramps Before They Start
If you get cramps regularly, especially at night, daily calf stretching is one of the best-supported preventive strategies. Cleveland Clinic recommends standing about three feet from a wall, leaning forward with your arms outstretched and feet flat on the floor, holding for a count of five, and repeating for at least five minutes. Doing this three times a day can meaningfully reduce the frequency of nocturnal leg cramps.
Staying hydrated matters, particularly if your cramps come during or after exercise. Dehydration doesn’t cause cramps on its own, but it makes muscles more susceptible to them. Drink water consistently throughout the day rather than trying to catch up all at once.
Potassium-rich foods like bananas, potatoes, and avocados support normal muscle function, and making sure you get enough sodium during heavy sweating can help too. But the electrolyte story is more nuanced than most people think. A Cochrane review found that magnesium supplements, despite their popularity for cramps, performed no better than placebo for reducing cramp frequency in older adults with nocturnal leg cramps. Across five studies with over 300 participants, the difference was less than one-fifth of a cramp per week. If you’re not actually deficient in magnesium, supplementing is unlikely to help.
One small but intriguing study published in the journal Neurology found that a B-vitamin complex (including 30 mg of vitamin B6 daily) led to cramp remission in 86% of treated patients compared to placebo. The study was small, just 28 people, and the participants weren’t known to be vitamin deficient. It’s not definitive, but it suggests B vitamins may be worth trying if cramps are a recurring problem.
Relieving Menstrual Cramps
Menstrual cramps are a different beast from muscle cramps. They’re caused by hormone-like chemicals called prostaglandins that trigger the uterus to contract, restricting blood flow and creating pain. The most effective over-the-counter treatment is an anti-inflammatory painkiller, which works by directly reducing prostaglandin production. Ibuprofen and naproxen are preferred because they reach peak levels in the bloodstream within 30 to 60 minutes, giving relatively fast relief.
Timing matters more than most people realize. Taking an anti-inflammatory at the very first hint of cramping, or even a day before your period typically starts, prevents prostaglandins from building up in the first place. Waiting until the pain is severe means those chemicals have already done their work, and you’re playing catch-up.
Heat is also genuinely effective for menstrual cramps, not just comforting. A heating pad or warm water bottle on your lower abdomen relaxes the uterine muscle and improves blood flow. Some studies have found heat therapy comparable to over-the-counter painkillers for mild to moderate cramps. Gentle exercise like walking or yoga can also help by boosting circulation, even though it’s the last thing most people feel like doing.
What Doesn’t Work (and What’s Dangerous)
Quinine, once commonly prescribed for nighttime leg cramps, is not considered safe or effective for this purpose. The FDA issued a specific warning stating that quinine is only approved for treating malaria. When used for leg cramps, it carries serious risks including a dangerous drop in blood platelets, heart rhythm problems, and severe allergic reactions. Fatalities and kidney failure requiring dialysis have been reported. If someone suggests quinine or tonic water for your cramps, the risk far outweighs any potential benefit.
As noted above, magnesium supplements are widely marketed for cramps but lack strong evidence in people who aren’t deficient. If you suspect a deficiency, getting tested is more useful than blindly supplementing.
When Cramps Signal Something Else
Most cramps are harmless, but leg pain that consistently appears during walking and goes away with rest can indicate reduced blood flow from peripheral artery disease. This is called claudication, and it mimics a cramp but has a distinct pattern: the pain reliably shows up during exertion and fades within minutes of stopping. As the condition progresses, the pain can occur at rest too. Cool skin on the affected leg, numbness, or skin color changes are additional warning signs. This is especially worth considering if you’re over 50, smoke, or have diabetes or high blood pressure.
Cramps that happen frequently despite adequate hydration and stretching, cramps that are severe enough to wake you multiple times a week, or cramps accompanied by muscle weakness or swelling may point to an underlying condition worth investigating with a healthcare provider.

