Magnesium is easy to get from ordinary food: seeds, nuts, beans, leafy greens, whole grains, tofu and fish are the best sources. Building a moderate, magnesium-rich dinner and finishing it a few hours before bed is a sensible, food-first way to support a calmer evening, but it is not a sleep cure. Research links magnesium status with sleep quality, while trials of magnesium for sleep have given mixed results.
Here is what the evidence actually says, how much you need, and a set of evening plates you can put together in 20 minutes.
What magnesium does, and what it doesn’t
Magnesium helps turn the food you eat into energy and supports normal function of the parathyroid glands, which make hormones important for bone health, according to the NHS. It also plays a role in nerve and muscle function, which is why it often comes up in conversations about relaxation.
On sleep specifically, a 2023 systematic review in Biological Trace Element Research looked at nine studies with more than 7,500 adults. Observational studies suggested an association between magnesium status and sleep quality, but the randomized trials reported contradictory findings. In short: getting enough magnesium is part of a healthy pattern that may support sleep, but it is not proven to fix sleep problems on its own.
That is a good reason to focus on meals rather than pills. Foods rich in magnesium also bring fibre, protein and other nutrients that help you feel satisfied in the evening.
How much magnesium you need
Dietitians of Canada’s Unlock Food lists these daily amounts for adults:
| Group | Magnesium per day |
|---|---|
| Men 19 to 30 | 400 mg |
| Men 31 and older | 420 mg |
| Women 19 to 30 | 310 mg |
| Women 31 and older | 320 mg |
Unlock Food also notes that magnesium from food and water is safe above these amounts, but supplements should stay at or below 350 mg a day unless a professional advises otherwise. The NHS adds that high-dose supplements can cause diarrhoea.
The best food sources
Legumes, nuts, seeds, fish, leafy greens and whole grains are the best sources. These figures come from Unlock Food’s table:
| Food | Serving | Magnesium (mg) |
|---|---|---|
| Pumpkin or squash seeds | ¼ cup (60 mL) | 307 |
| Sunflower seeds | ¼ cup (60 mL) | 129 |
| Black-eyed peas | ¾ cup (175 mL) | 121 |
| Almonds | ¼ cup (60 mL) | 88 to 109 |
| Tofu (made with magnesium chloride or calcium sulphate) | ¾ cup (175 mL) | 55 to 99 |
| Beans, any variety | ¾ cup (175 mL) | 58 to 89 |
| Spinach | ½ cup (125 mL) | 83 |
| Swiss chard | ½ cup (125 mL) | 80 |
Notice how quickly a few choices add up. A quarter cup of pumpkin seeds on a salad, plus a serving of beans, plus a side of greens covers a large share of a day’s needs in one meal.

Five evening plates built around magnesium
Each plate follows the same pattern: a magnesium-rich protein, a whole grain or starchy base, a leafy green or vegetable, and a sprinkle of seeds or nuts.
- Black bean and quinoa bowl. Black beans, quinoa, sautéed spinach, avocado and a spoonful of toasted pumpkin seeds. Finish with lime.
- Salmon with brown rice and chard. Baked salmon, brown rice, garlicky Swiss chard and a few sliced almonds on top.
- Tofu stir-fry. Firm tofu, broccoli and bok choy over brown rice or soba noodles, with sesame seeds and a light ginger-garlic sauce.
- Lentil and vegetable soup. Lentils, carrots, tomatoes and a handful of spinach stirred in at the end, served with whole grain bread.
- Chickpea and greens skillet. Chickpeas warmed with spinach, garlic and cumin, topped with plain yogurt and sunflower seeds, with whole wheat pita on the side.
Keep portions moderate. The NHS sleep guidance notes that eating large meals close to bedtime may make it harder to fall asleep, so aim to finish dinner a couple of hours before you turn in.
Make it easy on weeknights
The plates above come together fastest when a few components are ready before the evening starts:
- Cook grains once. A pot of brown rice or quinoa on the weekend covers three or four dinners. Cool it quickly and refrigerate it in shallow containers.
- Keep canned beans and lentils on hand. Rinse and drain them for a magnesium-rich protein in under five minutes.
- Toast a jar of seeds. Pumpkin, sunflower and sesame seeds toasted in a dry pan keep for a couple of weeks in a sealed jar and turn any bowl, soup or salad into a better source.
- Buy pre-washed greens or frozen spinach. Frozen spinach stirs straight into soups, sauces and skillets.
- Swap refined grains for whole grains. Brown rice instead of white, whole wheat pasta or pita instead of white, and oats at breakfast all nudge your daily total up without changing what you cook.
A light snack if you need one
If you are genuinely hungry later, a small snack can be better than going to bed distracted by hunger. Magnesium-friendly options include:
- A small handful of almonds or cashews
- Whole grain toast with peanut butter
- Plain yogurt with a spoonful of pumpkin seeds
- A banana with a few walnuts
What to ease off in the evening
- Caffeine. The NHS points out that coffee, tea and some soft drinks contain caffeine, which can make you feel more awake. It suggests a warm milky drink or herbal tea instead. Warm milk, chamomile, rooibos or peppermint tea all fit well.
- Alcohol. Alcohol can disrupt sleep. Skipping it supports better rest as well as your weight and health goals.
- Very large, heavy or very spicy meals late at night. If reflux or indigestion keeps you up, eat earlier and keep the last meal lighter.
Food is one part of a good night. A regular bedtime, a wind-down routine and a dark, cool bedroom matter too. Our article on nutrition and sleep covers the bigger picture, and sleep and cravings explains why short sleep makes next-day eating harder.
Food or supplement?
For most people, a varied diet with the foods above provides enough magnesium. Supplements can make sense for some people, but they interact with certain medicines and are not suitable for everyone, especially people with kidney problems. If you are considering one, talk to your doctor or pharmacist about the type, the amount and whether it fits your medications.
When to check with a professional
- You have trouble sleeping most nights for several weeks, or daytime sleepiness affects work or driving.
- You snore loudly or someone notices pauses in your breathing at night.
- You have kidney disease, a digestive condition, or take medicines such as diuretics or acid reducers and want to change your magnesium intake.
- You want to start a magnesium supplement.
Quick takeaways
- Seeds, nuts, beans, leafy greens, whole grains, tofu and fish are your best magnesium sources.
- Build dinner around one magnesium-rich protein, a whole grain, greens and a sprinkle of seeds.
- Keep dinner moderate and finish it a couple of hours before bed.
- Swap evening caffeine for warm milk or herbal tea, and skip alcohol.
- Evidence linking magnesium and sleep is promising but mixed, so pair good food with good sleep habits.
FAQ
Do I need to eat magnesium foods at dinner for them to count?
No. Your daily total matters most. Dinner is simply a convenient place to fit in beans, greens, whole grains and seeds, and a satisfying evening meal can make it easier to wind down without late-night snacking.
Is dark chocolate a good evening source?
It contains some magnesium, but it also contains a little caffeine and is easy to overeat. If you enjoy it, a small square earlier in the evening is a better fit than a large portion right before bed.