Evidence-based · GLP-1 & Metabolic

Muscle Cramps on a GLP-1 or Fast: The Magnesium Fix
Muscle cramps on a GLP-1, keto, or fast are usually an electrolyte gap. What magnesium can (and can't) fix, honest targets, and who must be careful.
Part ofThe GLP-1 Guide→Few things derail a GLP-1, keto diet, or extended fast faster than a calf that seizes at 2 a.m. Muscle cramps are one of the most common complaints in the first weeks of any of these, and the reflex fix everyone reaches for is magnesium. That instinct is partly right and partly oversold. This piece explains why cramps show up in the first place, what magnesium genuinely does and doesn’t do for them, and how to set honest targets for magnesium alongside the other electrolytes that matter. If you’d rather jump to your numbers, the electrolyte and hydration calculator turns your body weight and situation into concrete daily targets.

Why cramps show up on a GLP-1, keto, or a fast
Cramps are a signaling problem in muscle, and the signals depend on fluid and minerals being in balance. All three of these situations disturb that balance, by slightly different routes.
On keto or an extended fast, insulin falls. Insulin normally tells the kidneys to hold on to sodium, so when it drops, the kidneys dump sodium, and water and other electrolytes follow it out. That rapid loss is the core of the “keto flu,” and cramps are one of its signatures.
Muscle cramps on a GLP-1, keto diet, or fast usually trace back to low fluid and electrolytes: magnesium, but also sodium and potassium.
On a GLP-1, the mechanism is different: the drug blunts appetite so you eat less, which means less sodium, potassium, and magnesium coming in, and GI side effects like vomiting or diarrhea can strip more out. Either way you land in the same place: a body low on fluid and the minerals that keep muscle firing smoothly. So while magnesium gets the headlines, cramps are usually a combined sodium, potassium, magnesium, and water problem, not a magnesium problem alone.
What magnesium does, and the honest limits
Magnesium is involved in normal muscle and nerve function, and the NIH Office of Dietary Supplements lists “muscle contractions and cramps” among the signs of worsening magnesium deficiency, alongside numbness, tingling, and abnormal heart rhythms. So if your cramps stem from a real magnesium shortfall (plausible when you’re eating very little), correcting that shortfall can help.
The honest part most supplement marketing skips: magnesium is not a reliable cramp cure for everyone. A Cochrane review of randomized trials found that magnesium supplements did not produce a meaningful reduction in the intensity or duration of muscle cramps versus placebo over about a month, with the important caveat that those studies didn’t measure whether participants were deficient to begin with. The sensible reading is this: magnesium helps cramps that are caused by low magnesium; it’s much less impressive for cramps that aren’t. Since low intake is common on a GLP-1 or fast, it’s a reasonable thing to correct. Just don’t expect it to fix a cramp that’s driven by dehydration or low sodium.

Honest targets
These are general ranges for otherwise healthy adults. Read the safety section below first. They are not for everyone.
| Electrolyte | Adult target | Deficiency link to cramps | Common food / form |
|---|---|---|---|
| Magnesium | RDA ~400–420 mg/day (men), ~310–320 mg/day (women) | Cramps, contractions listed as deficiency signs | Nuts, seeds, leafy greens; glycinate or citrate supplements |
| Potassium | ~3,000–4,700 mg/day | Low potassium contributes to cramps and weakness | Avocado, greens, salmon; food first |
| Sodium | Kept steady; higher on keto/fast | Low sodium is an underrated cramp driver | Salt, broth, electrolyte mix |
| Fluid | ~30–35 mL/kg body weight/day | Dehydration is a leading cramp cause | Water plus sodium-containing fluids |
A few notes on the forms. Magnesium glycinate is gentle and well absorbed; magnesium citrate is also well tolerated and has a mild laxative effect, which is a bonus if the constipation that often rides along with GLP-1s and keto is also bothering you. Cheap magnesium oxide is poorly absorbed and mostly known for loosening stools. Whatever the form, keep supplemental magnesium in the sensible range rather than mega-dosing. More is not better, and it will find your bowels first.
For potassium, chase it through food, not pills: over-the-counter potassium is legally capped at small doses precisely because high-dose potassium can be dangerous. And don’t overlook sodium — a surprising share of cramps on a fast or strict keto resolve with salt and water alone, before magnesium enters the picture. The full sodium/potassium/magnesium breakdown lives in our companion guide, electrolytes on a GLP-1 or extended fast.
Fix the whole picture, not just one mineral
Because cramps are usually a combined deficit, the practical protocol is to address all the inputs at once rather than betting everything on a magnesium capsule:
- Rehydrate deliberately to roughly 30–35 mL/kg of fluid a day, more in heat or with exercise, sipped across the day rather than chugged.
- Get sodium in via broth or an electrolyte mix, especially on keto or fasting days when your kidneys are wasting it.
- Cover magnesium and potassium from food first — nuts, seeds, leafy greens, avocado, fish — then use a well-absorbed magnesium supplement (glycinate or citrate) to close the gap.
- Stretch and move the affected muscle when a cramp hits; gentle activity and warmth help the acute episode even while you fix the underlying balance.
If you’re wondering whether the branded electrolyte and magnesium products aimed at athletes are worth your money — versus just food and salt — that’s a fair question with a nuanced answer, and we sort the marketing from the genuine need in electrolytes and recovery: sorting marketing from need.

The safety caveat you must not skip
These targets assume healthy kidneys and heart. They are actively unsafe for some people. If you have kidney disease, heart failure, or take a diuretic (“water pill”), blood-pressure medication, or a potassium-sparing drug (such as spironolactone, an ACE inhibitor, or an ARB), do not follow generic electrolyte targets. Potassium is the most dangerous to supplement in those situations: impaired kidneys or a potassium-sparing drug can let blood potassium climb to a level that disrupts heart rhythm — a genuine emergency. Magnesium, too, can accumulate to harmful levels when kidney function is reduced. In any of these cases the right numbers come from your clinician, not from a table.
One more flag: cramps are usually benign, but severe, persistent, or spreading cramps, cramps with significant weakness, or anything alongside palpitations, chest pain, or confusion are reasons to seek care rather than reach for another supplement.
The takeaway
Muscle cramps on a GLP-1, keto diet, or fast are almost always a fluid-and-electrolyte gap, not a single-mineral deficiency. Magnesium is a reasonable and worthwhile piece — it clearly helps when a real magnesium shortfall is driving the cramps — but the evidence says it’s no magic bullet on its own, so fix the whole picture: fluid, sodium, potassium, and magnesium together. Use food first, add a well-absorbed magnesium form to close the gap, and turn these ranges into your own daily numbers with the electrolyte and hydration calculator. And if any kidney or heart condition or the medications above apply to you, that clinician conversation is the first step, not the last.
This article is educational and is not medical advice. Persistent or severe cramps, and any change to your medications or supplement routine, should be discussed with a qualified clinician.
Sources
References
Stay current
Get evidence-based briefings in your inbox.