Quick Summary: My sister-in-law Sara’s midnight leg cramps and restless nights turned out to be linked to a mild magnesium shortfall after she went vegan. Once she started eating spinach, almonds, avocado, and black beans consistently, the cramps became rare within five weeks and her sleep felt genuinely restful by week eight, with no supplements involved.
Introduction

My sister-in-law, Sara, had gone completely vegan about a year ago, mostly for animal welfare reasons rather than health. One night around midnight, she called me, half laughing and half nervous, because her calf muscles had become so stiff that she couldn’t straighten her foot on the floor.
It happened again the next week, then a third time a few weeks later. Around the same time, she reported that she was sleeping badly, waking up at awkward times, and feeling restless instead of relaxed. Since he was the family member who Googled everyone’s symptoms, I started digging, and the same answer cameover and over again: vegan foods high in magnesium, or especially their lack of them in her everyday foods. What started as a favour for Sarah, I really learned from myself because I hadn’t even thought well about my magnesium intake.
Table of Contents
Why Magnesium Is Easy to Miss on a Vegan Diet
Magnesium is involved in muscle contraction and relaxation, nerve signalling, blood sugar regulation, and how well the body winds down for sleep [1]. When levels run low, muscle cramps and poor-quality sleep are two of the earliest and most common signs, alongside fatigue and irritability that are easy to blame on something else entirely.
Sara’s 2am cramp was the moment she finally said something out loud, but looking back, smaller signs had been there for weeks. An eyelid that twitched occasionally during meetings. A heaviness in her legs by evening that she’d been blaming on standing too much at work. Neither felt significant enough on its own to mention to anyone.
It isn’t that vegan diets are inherently short on magnesium. Plenty of plant foods are excellent sources of it, often better sources than the animal products they replace. The real issue, in Sara’s case, was that once she cut out meat and dairy, she leaned heavily on convenience foods like white bread, pasta, and plant-based ready meals, without deliberately replacing what she’d cut with magnesium-rich whole foods.
There’s a quieter pattern here too. A lot of people equate “eating healthy vegan” with cutting things out, rather than actively adding specific nutrient-dense foods back in. Sara had spent most of her mental energy avoiding animal products and very little thinking about what needed to fill that space. It’s a distinction her GP later put simply: removing food groups is easy to plan around; deliberately replacing what they provided takes more thought.
How We Found Out It Was Magnesium
Sara mentioned the cramps to her GP almost as an afterthought during an unrelated appointment. Because the symptom was so specific and repeated, the GP suggested a blood test. Her magnesium came back at the low end of normal — not dramatically deficient, but low enough to plausibly explain both the cramps and the disrupted sleep.
“It wasn’t a huge red flag on paper,” Sara told me afterwards, “but the GP said it lined up too well with everything I’d described to be a coincidence.”
Her GP explained that mild magnesium shortfalls are more commonly seen in vegan and plant-based diets, partly because certain plant compounds called phytates can reduce how much magnesium the body actually absorbs, even when intake looks adequate on paper. Soaking, sprouting, or fermenting foods like beans and grains can reduce phytate content somewhat, though Sara didn’t go that far — she found it easier to simply eat a wider variety of magnesium-rich foods rather than trying to optimise absorption from any single one.
That distinction mattered. Sara didn’t need to eat dramatically more magnesium-containing food in theory. She needed to eat the right foods, consistently, rather than relying on convenience substitutes that were quietly low in the nutrient. Her GP also mentioned something I hadn’t considered: cooking method matters. Boiling vegetables in a lot of water can leach out magnesium, while steaming or roasting tends to preserve more of it. It was a small detail that changed how Sara — and eventually I — cooked vegetables generally, not just for magnesium.
The 4 Vegan Foods High in Magnesium That Made the Difference
After that GP appointment, Sara and I sat down and picked four foods that gave her the most magnesium for the least daily effort, based on what she’d actually enjoy eating regularly rather than what looked most impressive on a nutrition chart.
1. Spinach
A single cooked serving of spinach provides a substantial amount of magnesium, alongside iron and fibre, which made it an obvious first choice since Sara was already mildly concerned about her iron levels too. She started wilting a large handful into pasta sauces and curries, where it more or less disappears into the dish. She also began adding it to her morning smoothie a few times a week, a habit she picked up after we looked into which dried fruits are also naturally high in magnesium and realised how easily a few ingredients could be combined into one routine. Lightly steaming rather than boiling became her default after that conversation with her GP.
2. Almonds
A small daily handful of almonds became Sara’s easiest win, since it needed no preparation at all. Beyond magnesium, almonds provide healthy fats, plant protein, and vitamin E, which made them feel like a genuinely useful snack rather than a box to tick. She now keeps a small jar at her desk, not unlike a habit I picked up myself after reading about plant-based proteins that also happen to support magnesium intake. Her GP’s rough guide was around twenty almonds a day, not an exact prescription, and she found that swapping her mid-afternoon biscuit for a small handful was an easy substitution rather than an added extra.
3. Avocado
One medium avocado offers a meaningful amount of magnesium alongside fibre, healthy fats, and antioxidants. Sara was already eating avocado occasionally, but started having it almost daily instead — mashed onto toast for breakfast or sliced into lunch bowls — which made it an easy nutrient boost without feeling like a deliberate health intervention. Her husband adopted the habit alongside her, mostly because he liked it on toast just as much, and it ended up being the change that required the least willpower of the four.
4. Black Beans
Black beans quietly became the backbone of several of Sara’s dinners, providing both magnesium and a solid amount of plant protein in the same serving. She started batch-cooking a large pot at the weekend to use across the week in burritos, salads, and soups, which solved the “too tired to cook properly” problem that had been pushing her toward convenience food in the first place. It became, by her own account, the single habit that made everything else on this list easier to sustain.
Rough Magnesium Content Per Serving
| Food | Typical Serving | Approx. Magnesium |
| Spinach (cooked) | 1 cup | ~157mg |
| Almonds | 20 almonds (~28g) | ~76mg |
| Avocado | 1 medium | ~58mg |
| Black beans (cooked) | 1 cup | ~120mg |
Other Vegan Magnesium Sources Worth Knowing
These four foods worked well for Sara because they fit naturally into meals she already liked, but they’re far from the only options. Pumpkin seeds are one of the most concentrated plant sources of magnesium by weight, and a small handful sprinkled over porridge or salad adds up quickly — similar to the magnesium-rich seeds worth snacking on that Sara now keeps on hand. Dark chocolate with a high cocoa percentage contains a surprising amount too, though it’s easy to overestimate how much a typical serving actually provides, since the magnesium content quoted online often assumes a larger bar than most people actually eat in one sitting. Tofu, cashews, and quinoa are also reasonable contributors, and rotating a few of these into a weekly routine reduces reliance on any single food, which matters if variety in your diet is otherwise limited for any reason — whether that’s a busy week, travel, or simply not having certain ingredients in the house. Sara has since added pumpkin seeds to her rotation mainly because they’re easy to keep at her desk alongside the almonds, and she rotates in tofu stir-fries roughly once a week without treating it as a strict requirement.
What Changed After Adding These Foods Consistently
Sara didn’t notice a dramatic difference in the first week, and I want to be honest about that rather than overselling it. But by around the five-week mark, the night-time cramps had become noticeably rarer, and by week eight, she couldn’t remember the last time one had woken her up.
Her sleep improved too, though more gradually. She described it less as falling asleep faster and more as waking up feeling like the sleep had actually counted for something, rather than feeling like she’d been tossing and turning all night.
This lines up with what’s already understood about the nutrient — magnesium plays a documented role in regulating the nervous system and muscle function, and adequate intake has been linked to fewer nocturnal leg cramps and improved sleep quality, particularly in people starting from a mildly low baseline like Sara [2].
She also mentioned, almost as an afterthought during a family dinner, that her mood had felt steadier through what would normally have been a stressful work period. I’m cautious about overstating that connection, since plenty of factors affect mood, but it lined up with what her GP had said about magnesium’s broader role in the nervous system, and it was consistent enough across a few weeks that she brought it up unprompted a second time.
Common Mistakes Vegans Make With Magnesium
The most common mistake, and one Sara nearly made herself, is reaching straight for a supplement instead of addressing food sources first. Whole foods deliver magnesium alongside fibre and other nutrients that support absorption, something a supplement taken in isolation can’t fully replicate.
Important: Magnesium supplements can interact with certain medications, including some antibiotics, diuretics, and blood pressure medication, and aren’t recommended without medical advice for people with kidney conditions, since the kidneys are responsible for clearing excess magnesium from the body.
The second mistake is assuming that because a food is plant-based, it’s automatically a strong magnesium source. White bread, white rice, and many processed vegan convenience meals contain very little — exactly the trap Sara had fallen into without realising it, largely because the packaging language around “plant-based” products rarely mentions micronutrient content at all.
The third mistake is treating one magnesium-rich meal as enough to cover a shortfall. Consistency across the week mattered far more for Sara than any single nutrient-dense dinner, since the body doesn’t store and release magnesium the way it does some other nutrients, which means sporadic effort tends to produce sporadic results.
How to Get Enough Magnesium on a Vegan Diet Without Overthinking It
Sara’s routine now is genuinely simple. Spinach goes into at least one meal a day, almonds live in a jar at her desk, avocado replaces butter or spread most mornings, and a batch of black beans covers two or three dinners a week without extra effort.
Tip: She’s also started paying attention to magnesium-rich seeds worth snacking on as an easy salad or yoghurt addition, and reaches for foods that support winding down before bed on evenings when she wants something light before sleep rather than reaching for anything processed.
Who Should Be Extra Mindful of Magnesium Intake
A few groups should pay particular attention before significantly increasing magnesium intake or considering a supplement. People with kidney conditions should speak to a doctor first, since impaired kidney function affects how magnesium is processed and cleared.
This is also worth keeping in mind if you’re managing several health conditions at once, since magnesium needs and safe upper limits can shift depending on what else is going on in the body — exactly why food-first changes are generally the safer starting point compared to jumping straight to supplementation, and why “more is better” isn’t a safe assumption with any mineral.
- Anyone on diuretics or certain blood pressure medications, due to potential interactions.
- Pregnant or breastfeeding women, who should check appropriate intake levels with a GP or midwife.
- Anyone with a diagnosed kidney condition, due to reduced ability to clear excess magnesium.
- People already taking a magnesium supplement, before adding significantly more through diet changes.
For most healthy adults, getting magnesium primarily through food, the way Sara has, carries very little risk and comes with the added benefit of fibre, protein, and other nutrients that supplements alone don’t provide. If you fall into any of the groups above and are still keen to increase your intake, a quick conversation with a GP or pharmacist first is a small step that avoids a much bigger headache later, particularly around medication interactions that aren’t always obvious from a patient information leaflet alone.
Conclusion
The cause of Sarah’s leg pain and restless nights turned out to be fairly common, when we really explored it. The four available vegan foods high in magnesium — spinach, almonds, avocados, and black beans — made a real difference in a few months without supplements or complicated things. If you’re on a plant-based diet and are experiencing similar symptoms, these four diets are a reasonable place to start, and a blood test is a reasonable next step if symptoms persist after a few weeks of dietary changes.
Medical Disclaimer: This article is for informational purposes only and doesn’t constitute medical advice. Please consult your GP before making significant dietary changes or starting any new supplement, particularly if you have an existing health condition.
Frequently Asked Questions
What vegan foods are highest in magnesium?
Spinach, almonds, avocado, and black beans are among the most accessible vegan foods high in magnesium, alongside pumpkin seeds and dark chocolate.
Can magnesium deficiency cause leg cramps?
Yes, low magnesium levels are commonly linked to nocturnal leg cramps and muscle spasms, since magnesium plays a key role in muscle relaxation.
How much magnesium do vegans need per day?
Most adults need around 300 to 400mg of magnesium daily, though vegans may benefit from aiming slightly higher due to reduced absorption from plant sources.
Does magnesium help with sleep?
Yes, magnesium supports the nervous system and muscle relaxation, both of which contribute to improved sleep quality, particularly in people with a mild shortfall.
Should vegans take a magnesium supplement?
Not necessarily. Food-first sources are generally recommended, with supplements considered only after consulting a doctor if a deficiency is confirmed.
7 thoughts on “Vegan Foods High in Magnesium: 4 That Fixed My Sister-in-Law’s Leg Cramps”
Comments are closed.