For most muscle cramps, a combination of magnesium, potassium, and proper hydration is the most effective place to start. These are the building blocks your muscles need to contract and relax normally, and running low on any of them can trigger painful cramping. Beyond supplements, a few surprising remedies like pickle juice have real science behind them, while one old standby (quinine) has been pulled from the recommended list entirely.
Magnesium: The Most Common Deficiency Behind Cramps
Magnesium plays a direct role in muscle relaxation. When your levels drop too low, muscles can contract involuntarily and stay locked up, which is exactly what a cramp is. Low magnesium also contributes to fatigue, weakness, headaches, and trouble sleeping, so if you’re dealing with cramps alongside any of those symptoms, a deficiency is worth investigating.
The recommended daily intake is 310 to 320 mg for adult women and 400 to 420 mg for adult men, depending on age. Many people don’t hit those numbers through diet alone, especially if they sweat heavily, drink alcohol regularly, or take certain medications. Magnesium glycinate is one of the better-absorbed forms and tends to be gentler on the stomach than magnesium oxide, which can cause loose stools. Magnesium citrate is another well-absorbed option, though it has a mild laxative effect at higher doses.
Foods rich in magnesium include pumpkin seeds, almonds, spinach, black beans, and dark chocolate. If you’re supplementing, start with a moderate dose (around 200 to 300 mg) and give it a few weeks. Magnesium stores rebuild gradually, so you won’t see overnight results.
Potassium, Sodium, and Calcium
Your muscles rely on a balance of electrolytes to fire and release properly. Potassium helps your cells, heart, and muscles function correctly. Sodium helps nerves and muscles communicate. Calcium is involved in the contraction signal itself. When any of these drop too low, whether from sweating, vomiting, diarrhea, or simply not eating well, your muscles become more prone to involuntary contractions.
Most people get enough sodium from food without trying, but potassium is a different story. Bananas get all the credit, but potatoes, sweet potatoes, avocados, and beans actually contain more potassium per serving. If you’re cramping during or after exercise, a drink with both sodium and potassium (a basic electrolyte drink, not just water) can help more than water alone, because sweating depletes both minerals simultaneously. Plain water dilutes what’s left without replacing what you lost.
B Vitamins for Recurring Night Cramps
If your cramps tend to hit at night, B vitamins are worth considering. A small but notable trial found that daily supplementation with a B-complex vitamin (including vitamin B6) led to remission of muscle cramps in 86% of treated patients over 12 weeks, compared to no improvement in the control group. These participants weren’t known to be B-vitamin deficient, which makes the result more interesting. The American Academy of Neurology lists B-complex vitamins as “possibly effective” for muscle cramps based on this evidence, and no serious side effects were reported in the trials.
The evidence is limited (it comes from a single small study), but given the low risk and low cost, a B-complex supplement is a reasonable option if cramps are disrupting your sleep regularly and magnesium alone isn’t solving the problem.
Pickle Juice and Mustard
This one sounds like folk medicine, but the mechanism is real. Small amounts of pickle juice can relieve an active muscle cramp within about 85 seconds of drinking it. The explanation isn’t about electrolytes, since the volume is too small to change your blood chemistry that fast. Instead, the acetic acid in pickle juice (and the compounds in mustard) activate receptors in your mouth and throat called TRP channels. This triggers a reflex that increases inhibitory signals to the overexcited motor neurons driving the cramp, essentially telling the muscle to stand down.
A small sip or two is all it takes. Some athletes keep single-serving pickle juice packets on hand for exactly this purpose. It’s not a preventive strategy, but as a way to break an active cramp, it works faster than stretching in many cases.
Stretching and Heat
For an active cramp, gently stretching the affected muscle while it’s seizing can shorten the episode. For a calf cramp (the most common type), pull your toes toward your shin, either by hand or by standing and pressing your heel into the floor. Walking around once the worst passes helps the muscle return to its normal resting state.
A heating pad or warm towel applied to the cramping muscle can also help it relax. After the cramp subsides, some people find that the muscle stays sore for hours or even a day or two. Gentle stretching before bed, particularly of the calves and hamstrings, reduces the frequency of nocturnal cramps for many people even without supplements.
Why You Should Avoid Quinine
Quinine was once the go-to remedy for nighttime leg cramps, and some people still seek it out in tonic water or supplement form. The FDA has issued a boxed warning (its strongest safety label) against using quinine for leg cramps. Quinine can cause serious and potentially fatal blood reactions, including conditions that destroy platelets or damage red blood cells and kidneys. It can also trigger dangerous heart rhythm problems.
The FDA’s position is clear: quinine is not approved for the treatment or prevention of nighttime leg cramps, and the risks far outweigh any benefit for what is ultimately a painful but not dangerous condition. The small amount of quinine in commercial tonic water is far below a therapeutic dose and is generally considered safe as a beverage, but taking quinine pills or concentrated forms for cramps is not.
Cramps During Pregnancy
Leg cramps are extremely common during pregnancy, particularly in the second and third trimesters. The Mayo Clinic recommends pregnant women get 1,000 mg of calcium daily and consider a magnesium supplement, though the research on magnesium’s effectiveness specifically during pregnancy is mixed. Staying hydrated, stretching your calves before bed, and wearing supportive shoes during the day all help reduce frequency. If cramps are severe or accompanied by swelling, redness, or warmth in one leg, that warrants prompt medical evaluation (more on that below).
When a “Cramp” Might Be Something Else
Most muscle cramps are harmless, but a few warning signs suggest something more serious. A deep vein thrombosis (a blood clot in a deep vein, usually in the leg) can feel remarkably similar to a charley horse. The key differences: a DVT typically causes swelling in one leg, skin that looks reddish or bluish, and warmth to the touch in the affected area. The pain tends to persist rather than coming in a sudden spasm and releasing. If you have leg pain that came on without exertion and is accompanied by any of those signs, that needs immediate medical attention, since a clot can break loose and travel to the lungs.
Cramps that happen frequently despite adequate hydration and electrolyte intake, or cramps that are getting progressively worse over weeks, can occasionally point to nerve compression, thyroid problems, or medication side effects (statins and diuretics are common culprits). Persistent, unexplained cramping is worth bringing up with your doctor, especially if it’s interfering with sleep or daily activity.

