Leg cramps usually stop fastest when you stretch the affected muscle and hold it in a lengthened position. For longer-term relief, staying well hydrated, maintaining electrolyte balance, and stretching regularly before bed can reduce how often cramps happen. Most leg cramps are harmless, but some deserve a closer look depending on what’s triggering them.
How to Stop a Cramp Right Now
When a cramp hits your calf, straighten your leg and pull your toes up toward your shin. If you can reach your foot, grab your toes and gently pull them back. This forces the cramping muscle into a stretch, which helps it release. You can do this standing or sitting. Hold the stretch until the spasm passes, then massage the area with your hands or a tennis ball to ease residual soreness.
Applying heat during the cramp (a warm towel or heating pad) can help the muscle relax. Once the acute spasm is gone, ice may reduce any lingering tenderness. Walking around slowly after the cramp subsides also helps restore normal muscle tone.
The Pickle Juice Trick
Drinking a small amount of pickle juice can stop a cramp within seconds, and the reason has nothing to do with replacing lost salt. The acetic acid in pickle juice triggers receptors in the mouth and throat that send a signal to the spinal cord, telling the overactive nerve firing in the cramping muscle to quiet down. It’s a reflex response, not a hydration fix.
In a study published in Medicine and Science in Sports and Exercise, about 2.5 ounces of pickle juice (roughly one milliliter per kilogram of body weight) relieved electrically induced cramps faster than water. You don’t need much. Mustard works through a similar mechanism, which is why some athletes swear by a packet of yellow mustard during competition.
Hydration and Electrolytes
Dehydration is one of the most common and fixable causes of leg cramps, especially if you exercise regularly, work outdoors, or simply don’t drink enough water throughout the day. A practical formula from Mass General Brigham: multiply your body weight in pounds by 0.67 to get the ounces of water you should aim for daily. Add 12 ounces for every 30 minutes of exercise.
Plain water works for most people, but if you’re sweating heavily, a sports drink with sodium helps replace the electrolytes your muscles need to contract and relax properly. Potassium, calcium, and sodium all play roles in muscle function. Bananas, potatoes, yogurt, leafy greens, and avocados are solid food sources of these minerals.
Does Magnesium Actually Help?
Magnesium is probably the most popular supplement recommendation for leg cramps, but the clinical evidence is underwhelming. A Cochrane review, considered the gold standard for evaluating medical evidence, found that magnesium supplementation does not provide meaningful cramp relief for older adults with nocturnal leg cramps. Across multiple trials, the difference in cramp frequency between magnesium and placebo was small, not statistically significant, and remarkably consistent in showing no benefit.
The picture is muddier for pregnant women, where some studies suggest a possible benefit and others don’t. If you’re genuinely deficient in magnesium (blood tests can confirm this), supplementation makes sense for overall health. But taking magnesium specifically to prevent cramps likely won’t do much if your levels are already normal.
Stretching to Prevent Nighttime Cramps
Nocturnal leg cramps, the kind that jolt you awake at 3 a.m., affect up to 60% of adults at some point. A regular stretching routine before bed can reduce their frequency. Three stretches worth doing nightly:
- Wall calf stretch. Stand facing a wall with one foot forward and one back. Keep your back heel on the ground and lean into the wall until you feel the stretch in your back calf. Hold for 30 seconds, then switch.
- Towel hamstring stretch. Sit on the floor with your leg straight out. Loop a towel around the ball of your foot and gently pull toward you, keeping your knee straight. Hold for 30 seconds.
- Standing quad stretch. Stand on one leg, grab the opposite ankle behind you, and pull your heel toward your glute. Hold for 30 seconds per side.
Doing these consistently for a few weeks tends to produce noticeable improvement. The goal is to keep the muscles from shortening overnight, which is when most cramps strike.
Medications That Cause Cramps
If your leg cramps started around the same time as a new medication, that’s worth investigating. Statins, the cholesterol-lowering drugs taken by tens of millions of people, cause muscle pain and cramping in roughly 15% to 20% of users, with women affected more often than men. Diuretics (water pills) used for blood pressure can also trigger cramps by flushing out potassium and sodium.
Other common culprits include certain asthma medications, osteoporosis drugs, and some blood pressure medications. If you suspect a medication is behind your cramps, talk with your prescriber about adjusting the dose or switching to an alternative. Don’t stop taking prescribed medication on your own.
Why Quinine Is Not the Answer
Quinine, found in tonic water and once widely prescribed for leg cramps, carries serious risks that led the FDA to take action against its off-label use. Quinine is only approved for treating malaria. When used for leg cramps, it has been linked to a dangerous drop in blood platelets, severe allergic reactions, and heart rhythm problems. Fatalities and kidney failure requiring dialysis have been reported. The FDA has added its strongest warning label to quinine products specifically because of this off-label use. The small amount in a glass of tonic water is unlikely to cause harm, but it’s also unlikely to help.
Other Deficiencies Worth Checking
Beyond the usual electrolytes, vitamin B12 deficiency can cause muscle spasms, twitching, and cramping, particularly in the legs. B12 is essential for nerve function, and when levels drop, nerves misfire. This is more common in older adults, vegans, and people with digestive conditions that affect nutrient absorption. Vitamin D deficiency, which is widespread, has also been associated with muscle cramps and weakness. A simple blood test can check both.
When Leg Pain Isn’t Just a Cramp
Most leg cramps are benign, but certain symptoms point to something more serious. A deep vein thrombosis (a blood clot in a leg vein) can feel like cramping or soreness, typically starting in the calf. The key differences: DVT usually causes persistent pain rather than a sudden spasm that resolves, and it often comes with swelling in one leg, skin that looks red or purple, and warmth over the affected area. A blood clot can also cause no symptoms at all.
Cramps that happen frequently during walking and stop with rest may signal reduced blood flow to the legs from narrowed arteries. Cramps that are getting progressively worse, happening multiple times per night, or accompanied by muscle weakness, numbness, or visible swelling warrant a medical evaluation to rule out vascular or neurological causes.