What Helps With Leg Cramps: Remedies and Prevention

Stretching the cramping muscle is the single most reliable way to stop a leg cramp in progress, and staying hydrated, keeping electrolytes balanced, and stretching before bed are the best ways to prevent them from coming back. Most leg cramps are harmless, lasting anywhere from a few seconds to several minutes, but they can be surprisingly painful, especially the ones that strike in the middle of the night.

How to Stop a Cramp Right Now

When a cramp hits, your muscle is locked in an involuntary contraction. The fastest way to release it is to stretch the muscle in the opposite direction. For a calf cramp (the most common type), stand facing a wall or hold onto a chair. Step the cramping leg back, keep your heel flat on the floor, and lean your hips forward until you feel a deep stretch through the calf. Hold for 30 to 60 seconds. If the cramp is in the front of your thigh, pull your foot up behind you toward your glute. For cramps along the back of the thigh, sit down and straighten the leg in front of you, reaching toward your toes.

Gently massaging the knotted muscle while stretching can help it relax faster. Walking around for a minute or two after the cramp releases also helps restore normal muscle tone and blood flow.

Heat, Cold, or Both

Heat is generally more useful than ice for cramps. It reduces muscle stiffness and calms spasms, so applying a warm towel or heating pad to the area during or after a cramp can speed relief. Ice is better suited for injuries with inflammation and swelling. If the muscle stays sore after the cramp passes (which is common with severe nighttime cramps), heat can help with that lingering tenderness too.

Pickle Juice and Other Fast Remedies

It sounds like folk medicine, but pickle juice has some real science behind it. In a controlled study, drinking a small amount of pickle juice shortened cramp duration by about 49 seconds compared to water. That’s meaningful when you’re in pain. The effect kicks in faster than the liquid could be absorbed into the bloodstream, which suggests it isn’t about rehydration at all. Researchers believe the acetic acid (vinegar) triggers a reflex in the mouth and throat that tells the nervous system to shut down the overactive nerve signals causing the cramp. Mustard, which also contains acetic acid, gets recommended for the same reason.

Preventing Cramps Before They Start

Hydration and Electrolytes

Dehydration and electrolyte imbalances are among the most commonly cited triggers for leg cramps. When you sweat heavily, you lose sodium, potassium, calcium, and magnesium. Drops in any of these can make your muscles more prone to involuntary contractions. Sodium seems to play a particularly important role. In one well-documented case, a tennis player eliminated chronic heat cramps simply by increasing his daily sodium intake.

You don’t necessarily need sports drinks or electrolyte tablets. For most people, drinking enough water throughout the day and eating a balanced diet covers it. But if you exercise intensely, work outdoors in the heat, or notice cramps tend to follow heavy sweating, adding an electrolyte drink or salting your food more generously can help. Limiting alcohol and caffeine before bed is also worth trying, since both can contribute to dehydration overnight.

Bedtime Stretching

If nighttime cramps are your main problem, a few minutes of calf stretches or light pedaling on a stationary bike before bed can significantly reduce their frequency. Loosening the sheets and blankets at the foot of your bed also helps. Tight covers can push your feet downward, keeping calf muscles in a shortened position for hours, which makes cramps more likely.

Do Supplements Actually Work?

Magnesium

Magnesium is one of the most popular recommendations for leg cramps, but the evidence is surprisingly weak. A Cochrane review (the gold standard for evaluating medical evidence) looked at multiple trials using doses ranging from 100 to 520 mg of elemental magnesium daily. The conclusion: magnesium supplementation did not significantly reduce cramp frequency, intensity, or duration compared to placebo in people with ordinary nighttime cramps. The researchers stated it is “unlikely that magnesium supplementation is effective” for these cramps at any tested dose. Evidence for pregnancy-related cramps was too limited and conflicting to draw conclusions.

That said, magnesium is safe at recommended doses and plays a role in hundreds of body processes, so if you’re deficient, correcting that deficiency could still help. It’s just not the reliable cramp cure it’s often marketed as.

B Vitamins

There’s more promising, if limited, evidence for B vitamins. In a randomized, placebo-controlled trial of elderly patients with high blood pressure and severe nighttime leg cramps, 86% of those taking a B-complex supplement experienced significant remission of their cramps after three months. The placebo group saw no meaningful change. The study was small (28 patients), so it’s not definitive, but it’s a notable result for a supplement with minimal side effects. This may be most relevant if you’re older or take medications that deplete B vitamins.

Medications That Can Cause Cramps

If your leg cramps started or worsened after beginning a new medication, the drug itself could be the problem. The three medication classes most strongly linked to nocturnal leg cramps are diuretics (water pills), statins (cholesterol-lowering drugs), and inhaled long-acting bronchodilators used for asthma and COPD. In a large analysis published in JAMA Internal Medicine, inhaled bronchodilators showed the strongest association, more than doubling the likelihood of cramps. Diuretics came next, increasing risk by about 47%, followed by statins at 16%.

If you suspect a medication is behind your cramps, it’s worth bringing this up at your next appointment. There may be alternative drugs or dosing adjustments that help.

Quinine: A Remedy to Avoid

Quinine, found in tonic water and once widely prescribed for leg cramps, is no longer considered safe for this purpose. The FDA has made this clear in multiple warnings. Quinine can cause a dangerous drop in blood platelets, life-threatening allergic reactions, and heart rhythm abnormalities. Fatalities and kidney failure requiring dialysis have been reported. Quinine is only FDA-approved for treating malaria. The small amount in a glass of tonic water is unlikely to cause harm, but it’s also unlikely to help with cramps. Taking quinine tablets for cramps is a genuine safety risk.

When Cramps Signal Something Else

Most leg cramps are benign, especially if they happen occasionally and resolve quickly. But some symptoms warrant attention because they can mimic or accompany more serious conditions. Deep vein thrombosis (a blood clot in a deep leg vein) can feel like a cramp, with pain or soreness that typically starts in the calf. The key differences: DVT usually also causes leg swelling, skin that turns red or purple, and a feeling of warmth in the affected area. DVT can also occur without obvious symptoms, which is part of what makes it dangerous.

Cramps that happen frequently, don’t respond to stretching or hydration, cause severe pain, or come with muscle weakness, numbness, or visible swelling are worth investigating. Peripheral artery disease, nerve compression, and certain metabolic conditions can all present with cramping as an early symptom.