When a leg cramp strikes, the fastest relief comes from stretching the cramping muscle and holding the stretch until the spasm releases. But there’s a lot more you can do, both in the moment and over time, to make cramps less painful and less frequent. Here’s what actually works.
How to Stop a Cramp in the Moment
The type of stretch depends on where the cramp hits. For a calf cramp, keep your leg straight and pull the top of your foot toward your face. You can also stand up, put your weight on the cramping leg, and press down firmly. This same technique works for cramps in the back of the thigh. For a cramp in the front of your thigh, pull your foot up behind you toward your buttock (hold onto a chair for balance).
While stretching, gently massage the cramped muscle with your fingers. The combination of lengthening the muscle and rubbing it helps interrupt the involuntary contraction faster than either approach alone. Once the cramp passes, you may have lingering soreness for hours or even into the next day.
Dealing With Post-Cramp Soreness
After a cramp releases, the muscle can feel bruised and tender. Heat is your best option here. Applying a warm compress or heating pad brings more blood flow to the area, which helps clear out the chemical byproducts that build up during intense muscle activity. This is the same reason heat works on sore muscles after exercise. Save ice for acute injuries with visible swelling. A cramp itself doesn’t cause inflammation the way a sprain does, so warmth will feel better and do more good.
Preventing Nighttime Leg Cramps
Nocturnal leg cramps are especially common and disruptive. They tend to hit the calves, though they can affect the feet or thighs, and they often wake you from sleep with sudden, intense pain. A few strategies can reduce how often they happen.
Calf stretching before bed has been recommended for years as the simplest prevention measure. Stand facing a wall, place your hands on it, and step one foot back with the heel flat on the floor. Lean forward until you feel a stretch in the back calf. Hold for 20 to 30 seconds on each side. Light exercise before bed, like a few minutes on a stationary bike or treadmill, also appears to help, likely by loosening muscles that have been sedentary all day.
Deep tissue massage on the calves and surrounding muscles is another option worth trying, particularly if your cramps seem tied to muscle tightness or fatigue from physical activity during the day.
Hydration and Electrolytes
Dehydration is one of the most common and fixable contributors to muscle cramps. When your body loses fluid through sweat, illness, or simply not drinking enough, the balance of electrolytes shifts. Sodium controls fluid levels and supports nerve and muscle function. Potassium helps your heart, nerves, and muscles work properly. Both are lost through sweat, and when levels drop, muscles become more prone to involuntary contractions.
You don’t necessarily need a sports drink. For most people, consistent water intake throughout the day, combined with a diet that includes potassium-rich foods (bananas, potatoes, leafy greens) and adequate salt, is enough to keep electrolyte levels in a healthy range. If you’re cramping after heavy exercise or in hot weather, an electrolyte drink or even a salty snack can help replenish what you’ve lost more quickly.
Does Magnesium Help?
Magnesium supplements are widely marketed for leg cramps, but the evidence is underwhelming. A 2023 review from the American Academy of Family Physicians concluded that magnesium should not be used for short courses (under 60 days) to treat nighttime leg cramps, whether in the general population or during pregnancy. There is limited evidence that magnesium oxide taken daily might improve cramps after 60 or more days of consistent use, but this comes from a single trial. If you want to try it, set realistic expectations: it’s unlikely to provide quick relief, and the benefit, if any, takes months to appear.
The Pickle Juice Trick
Drinking a small amount of pickle juice to stop a cramp sounds like folk medicine, but there’s a plausible explanation behind it. The acetic acid in pickle juice stimulates receptors in the mouth and throat that trigger a nerve reflex. This reflex increases the activity of signals that tell the cramping muscle to relax. What’s interesting is that this appears to work too quickly to be explained by digestion or hydration. It’s a neural response, not a nutritional one. Studies have used about 1 milliliter per kilogram of body weight (roughly 2 to 3 ounces for most adults). Even just swishing it in your mouth and spitting it out may activate the same reflex.
B Vitamins and Other Supplements
A small trial of 28 older adults found that daily B-complex supplementation led to cramp remission in 86% of participants over 12 weeks, compared to no improvement in the control group. That’s a striking number, but the study was small and had significant reporting gaps. The overall evidence rating for B vitamins is low. Still, B-complex supplements are inexpensive and generally safe, making them a reasonable option to try if cramps are persistent, especially for older adults who may have marginal B vitamin levels without knowing it.
Medications That Cause Cramps
If your leg cramps started or worsened after beginning a new medication, the drug itself could be the cause. Statins, widely prescribed for high cholesterol, are one of the most common culprits. Muscle pain, soreness, and cramping are among the most frequent complaints from people taking them, with higher doses of certain statins (particularly simvastatin) carrying a greater risk. Diuretics, often used for blood pressure, can also trigger cramps by flushing out sodium and potassium through increased urination.
If you suspect a medication is behind your cramps, bring it up with whoever prescribed it. Switching to a different drug in the same class, adjusting the dose, or adding electrolyte support can often solve the problem without giving up the treatment you need.
Why Quinine Is No Longer Recommended
Quinine was once commonly prescribed for leg cramps, and some people still seek it out in tonic water or other forms. The FDA has made clear that quinine is not considered safe or effective for cramps. It is approved only for treating malaria. When used for cramps, quinine has been associated with a dangerous drop in blood platelets, severe allergic reactions, and heart rhythm disturbances. Fatalities and kidney failure requiring dialysis have been reported. Since 2006, the FDA has added a boxed warning (the strongest type of safety alert) to quinine labeling specifically about these risks in off-label use.
When Leg Pain Isn’t a Cramp
Most leg cramps are harmless, but certain symptoms suggest something more serious. Deep vein thrombosis (a blood clot in a leg vein) can feel like a cramp at first, with pain that typically starts in the calf and feels like cramping or soreness. The key differences: DVT pain usually affects only one leg, gets worse over time rather than releasing after a minute or two, and doesn’t improve with stretching or walking. The affected leg may also be swollen, red or discolored, and warm to the touch. If your leg pain persists, involves visible swelling, or worsens when you flex your foot, seek medical evaluation rather than treating it as a simple cramp.

