Our Services
Medical Information
Helpful Resources
Published on: 5/11/2026
Shifts in magnesium, potassium, calcium and sodium during fasting can trigger involuntary leg twitches by making nerves more excitable. Maintaining mineral levels through diet, mindful supplementation, homemade electrolyte drinks, hydration and gentle muscle care helps prevent spasms.
There are several factors to consider, so see below to understand more.
Leg twitches—those sudden, involuntary jerks in your calves or thighs—can disrupt sleep, exercise or simply your day-to-day comfort. They're common during any fast, including a juice cleanse, when shifts in hydration and mineral balance can trigger muscle excitability. Understanding the role of key minerals and how to maintain them can help you fast more comfortably and reduce the risk of annoying leg spasms.
Taken together, these factors can make leg muscles more likely to spasm or "twitch." Addressing the underlying mineral shifts is the most direct way to prevent or reduce these jerks.
Magnesium
Potassium
Calcium
Sodium
Magnesium is often the "missing link" in fast-related leg twitching:
Signs you might be low on magnesium:
Always check with a doctor before starting any new supplement, especially if you have kidney issues or take medications.
A juice cleanse can be a great way to reset, but fresh juices alone may lack enough minerals:
Proper fluid balance helps minerals move where they're needed:
Even with ideal mineral balance, your muscles benefit from gentle care:
If your leg twitches are intense, frequent or accompanied by a strong urge to move—especially at night—you might be dealing with a more specific condition. It's more than occasional cramps and can significantly disrupt sleep quality.
If you're experiencing persistent nighttime leg discomfort or uncontrollable urges to move your legs, use this free AI-powered Restless Leg Syndrome symptom checker to better understand whether your symptoms align with this common condition and what steps to take next.
Even if your results suggest low likelihood, persistent or severe symptoms deserve professional attention.
While most leg twitches are harmless, seek medical advice if you experience:
A healthcare professional can order blood tests (to check magnesium, potassium, calcium levels) or evaluate other causes of muscle hyperactivity.
By paying attention to these simple mineral and lifestyle strategies, you'll give your muscles the support they need to stay relaxed—no matter how long you fast.
(References)
* Garrison SR, Allan GM, Sekhon RK, Musini VM, Hartling L, Korownyk C. Magnesium for skeletal muscle cramps. Cochrane Database Syst Rev. 2020 Sep 21;9(9):CD009402. doi: 10.1002/14651858.CD009402.pub3. PMID: 32959807; PMCID: PMC8092497.
* Mehanna HM, Moledina J, Travis J. Refeeding syndrome: mechanisms, prevention, and treatment. BMJ. 2008 Jul 3;336(7659):1495-9. doi: 10.1136/bmj.39580.674519.AE. PMID: 18599427; PMCID: PMC2440847.
* Miller KC, Stone MS, Barnes BC, Fisch JE, Hargus EP, Lentz CM, Lightsey HM, Roe EJ, Scoville RL. Muscle cramps: Causes and treatment. J Am Acad Orthop Surg. 2010 Jun;18(6):331-40. doi: 10.5435/0019299-201006000-00003. PMID: 20516426.
* Fukumoto S. Hypocalcemia: Signs and Symptoms, Causes, and Treatment. In: De Groot LJ, Chrousos G, Dungan K, Feingold KR, Grossman A, Hershman JM, Koch C, Korbonits M, McLachlan R, New M, Purnell J, Rebar R, Singer F, Vinik A, editors. Endotext [Internet]. South Dartmouth (MA): MDText.com, Inc.; 2000-. 2015 Mar 12. PMID: 25905206.
* Anton SD, Moehl K, Donahoo WT, Phillips MD, Burke JR, Hanlon SM, Riechman LD, Mathews CE, Collins CE, Manini TM. Beneficial effects of fasting and caloric restriction on the cardiovascular system. Am J Med. 2017 Nov;130(11):1346.e1-1346.e10. doi: 10.1016/j.amjmed.2017.07.014. Epub 2017 Aug 1. PMID: 28778841; PMCID: PMC5787012.
We would love to help them too.
For First Time Users
We provide a database of explanations from real doctors on a range of medical topics. Get started by exploring our library of questions and topics you want to learn more about.
Was this page helpful?
Purpose and positioning of servicesUbie Doctor's Note is a service for informational purposes. The provision of information by physicians, medical professionals, etc. is not a medical treatment. If medical treatment is required, please consult your doctor or medical institution. We strive to provide reliable and accurate information, but we do not guarantee the completeness of the content. If you find any errors in the information, please contact us.