For those who prefer food over supplements, brazil nuts, almonds, and flaxseeds are reliable magnesium sources. When supplementing, a typical starting point cited is 100mg two to three times a day, adjusted to the severity of the deficiency. If loose stools or diarrhea occur, Dr. Tajbakhsh strongly advises stopping supplementation and consulting a professional.
Vitamin D plays a less obvious but equally important role: without adequate levels, the body cannot properly absorb calcium from food. People who eat a balanced diet yet still cramp may therefore be short on vitamin D rather than calcium itself. Mushrooms and seafood provide dietary vitamin D, while a supplement dose of 1,000 IU per day taken with a meal is suggested as a starting point, given that vitamin D is fat-soluble. As with magnesium, individualized professional advice is recommended before starting any supplement regimen.
What the research says
Two peer-reviewed studies underpin the key recommendations. A 2012 randomised trial in the Journal of Physiotherapy (Hallegraeff et al.) found pre-sleep stretching reduces the frequency and severity of nocturnal leg cramps in older adults. A separate randomised cross-over placebo-controlled trial published in Medical Science Monitor in 2002 (Sills et al.) examined magnesium citrate for chronic persistent leg cramps.
A targeted calf stretch backed by a randomised trial
Stretching is one of the most accessible preventive tools. A 2012 randomised trial published in the Journal of Physiotherapy by Hallegraeff and colleagues found that stretching before sleep reduces both the frequency and severity of nocturnal leg cramps in older adults.

Dr. Tajbakhsh describes a specific technique: place the ball of your foot on a low ledge — a stack of books works — while keeping your heel on the floor. Slowly shift your weight forward as if pressing a car accelerator, hold for a few seconds, then rest. Repeat 6 to 8 times on each foot. The movement targets the calves, the area where cramps most commonly strike.
The ledge should be kept low to avoid placing excessive pressure on the calf muscles. The simplicity of the exercise means it can be performed at home each evening without any equipment.
