How Do You Stop Cramps? Remedies for Every Type

To stop a muscle cramp that’s happening right now, gently stretch the cramping muscle and hold it until the spasm releases. For prevention, staying hydrated, keeping your electrolytes up, and stretching regularly are the most reliable strategies. The best approach depends on what kind of cramp you’re dealing with, so here’s what works for each type.

How to Stop a Cramp in the Moment

When a muscle seizes up, your instinct might be to grab it and squeeze, but the fastest relief comes from slowly stretching the affected muscle in the opposite direction of the contraction. If your calf cramps, flex your foot upward toward your shin. If your hamstring locks up, straighten your leg. Hold the stretch gently until the cramp subsides, which usually takes anywhere from 30 seconds to a couple of minutes.

Once the acute spasm passes, applying heat to the muscle helps it fully relax. Heat reduces muscle stiffness and lingering spasm, making it a better choice than ice for cramps. A heating pad, warm towel, or even a hot shower directed at the sore muscle all work. Ice is better suited for injuries with swelling or inflammation, not for the tight, knotted feeling a cramp leaves behind.

If you want a faster trick, pickle juice has surprisingly good evidence behind it. In a study published in Medicine and Science in Sports and Exercise, about 75 mL of pickle juice (roughly a third of a cup) stopped electrically induced cramps faster than water. The researchers found this wasn’t about replacing fluids or salt. The strong, acidic taste triggers a reflex in the mouth and throat that signals the nervous system to shut down the overactive nerve firing that causes the cramp. Any intensely sour or spicy liquid may work through the same mechanism, though pickle juice has the most research behind it.

Preventing Exercise-Related Cramps

Cramps during or after physical activity are the most common type, and they tend to hit muscles that are fatigued, dehydrated, or low on key minerals. Prevention comes down to three things: hydration, electrolytes, and conditioning.

Potassium plays a direct role in muscle function. It acts as a neuromuscular transmitter, helping nerves communicate with muscles. When potassium levels drop, that communication breaks down, and muscles can get stuck in a contracted position. Bananas are the classic source, though they only provide about 9 percent of your daily recommended intake. Potatoes, avocados, beans, and leafy greens are actually richer sources.

Dehydration amplifies the problem. When you lose fluid through sweat, the concentration of electrolytes in your blood shifts, making muscles more excitable and cramp-prone. Drinking water throughout the day is the baseline, but during heavy exercise or hot weather, a drink with sodium and potassium helps replace what you’re sweating out. Don’t wait until you feel thirsty to start drinking, especially during longer workouts.

Stretching before and after exercise also reduces cramp frequency. Focus on the muscles you’ll be using most. If you’re a runner, calves and hamstrings deserve extra attention. Hold each stretch for 20 to 30 seconds without bouncing.

Stopping Nighttime Leg Cramps

Nocturnal leg cramps are a separate category. They strike without warning, usually in the calf or foot, and they’re more common as you get older. The exact cause isn’t always clear, but shortened muscle position during sleep, prolonged sitting during the day, and mild electrolyte imbalances all contribute.

A pre-sleep stretching routine is one of the most effective preventive measures. Stretch your calves, hamstrings, and quads for a few minutes before getting into bed. Cleveland Clinic also recommends experimenting with sleeping positions: if you sleep on your back, keep your toes pointed upward rather than letting them drop. If you sleep on your stomach, let your feet hang over the end of the bed so your calves aren’t held in a shortened position all night.

Keep a heating pad and a massage roller next to your bed so you can respond quickly when a cramp hits. The combination of heat and gentle pressure on the muscle can cut recovery time significantly and help you get back to sleep.

One old remedy to avoid: quinine, the compound found in tonic water. It was once widely recommended for nighttime leg cramps, but the FDA has made clear that quinine is not considered safe or effective for this use. It’s associated with serious blood disorders, dangerous heart rhythm changes, kidney failure requiring dialysis, and even deaths. A boxed warning was added to prescription quinine specifically because of the risks tied to off-label use for leg cramps. Drinking tonic water contains far less quinine than a prescription dose, but the risk-to-benefit ratio still doesn’t favor it.

Relieving Menstrual Cramps

Period cramps have a completely different mechanism from muscle cramps. They’re caused by prostaglandins, hormone-like chemicals that make the uterus contract to shed its lining. Higher prostaglandin levels mean stronger, more painful contractions.

Anti-inflammatory pain relievers like ibuprofen and naproxen are the most effective first-line treatment. They work by directly blocking prostaglandin production, which both reduces pain and decreases the volume of menstrual flow. The key is timing: taking them at the first sign of cramps, or even just before your period starts, is more effective than waiting until the pain is already intense. Once prostaglandins have already been released in large amounts, it’s harder to get ahead of the pain.

Heat works well alongside pain relievers. A heating pad on your lower abdomen relaxes the uterine muscle and can be as effective as over-the-counter medication for mild to moderate cramps. Some people find that light physical activity, like walking or yoga, also helps by increasing blood flow and releasing natural pain-relieving chemicals in the brain.

When Cramps Signal Something Else

Most cramps are harmless, if painful. But cramps that keep coming back, happen in the same spot, or don’t respond to the usual strategies can sometimes point to an underlying issue.

Narrowed arteries in the legs can cause cramping pain during exercise that reliably goes away when you stop. This happens because the muscles aren’t getting enough blood flow to meet their demand during activity. It typically affects both legs, gets worse with walking, and improves with rest.

Nerve compression in the spine is another possibility. It causes cramping leg pain that worsens with walking but, in a distinctive pattern, eases when you lean forward. People with this condition often notice they feel better pushing a shopping cart or walking uphill because the forward lean opens up space around the compressed nerve.

Certain medications can also trigger cramps as a side effect, particularly diuretics (which flush electrolytes), cholesterol-lowering drugs, and some blood pressure medications. If your cramps started or worsened after beginning a new medication, that connection is worth exploring with your prescriber.

Supplements Worth Considering

Vitamin B complex supplements have some limited evidence for cramp reduction. One study found that a B complex supplement containing 30 mg of vitamin B6 per day led to cramp remission in 86 percent of treated patients compared to placebo. The study was small (28 patients), and the participants weren’t known to be vitamin-deficient beforehand, which makes the result more interesting. It’s not strong enough evidence to call it a proven treatment, but it’s a low-risk option if your cramps are persistent.

Magnesium supplements are widely recommended for cramps, particularly nighttime cramps and menstrual cramps. The evidence is mixed overall, but magnesium deficiency is common enough that supplementing is reasonable if your diet is low in nuts, seeds, whole grains, and dark leafy greens. Magnesium glycinate and magnesium citrate are the forms most commonly used for muscle-related issues.