Nutrition · Updated November 2026

Magnesium-Rich Foods for Sleep and Stress

The top magnesium-rich foods for sleep and stress support are pumpkin seeds (about 156 mg per ounce), chia seeds, almonds, cashews, cooked spinach, black beans, edamame, peanut butter, whole grains, dark chocolate, avocado, and bananas. Adults need 310–420 mg a day, and many people fall short. Getting enough magnesium supports normal nerve and muscle function, though it's not a sedative, and the evidence that it improves sleep is modest and mostly in people who are low.

Here's what magnesium actually does, how to eat more of it, and how to fit it into an evening routine that helps you unwind.

Why magnesium matters for sleep and stress

Magnesium is involved in hundreds of enzyme reactions, including those that regulate muscle and nerve function, blood sugar, blood pressure, and energy production. According to the Harvard Nutrition Source, it also plays a role in the transport of calcium and potassium across cell membranes, which matters for nerve signaling and muscle contraction.

For sleep, researchers are interested in magnesium's role in calming nervous system activity and its interaction with GABA, a neurotransmitter that promotes relaxation. For stress, the relationship seems to run both ways: stress may increase magnesium losses, and low magnesium may be linked with heightened stress responses. But much of this research is early.

What the evidence actually says

Let's be honest about the science:

  • A small randomized trial in older adults with insomnia found that 500 mg of supplemental magnesium daily for eight weeks improved several sleep measures compared with placebo.
  • Most studies are small, short, and focus on people who are older or likely to be low in magnesium.
  • There's little evidence that extra magnesium helps sleep in people who already get enough.

The takeaway: aim to meet your magnesium needs through food as part of a healthy sleep routine, rather than expecting a magnesium-rich snack to knock you out.

How much magnesium do you need?

From the NIH Office of Dietary Supplements:

GroupDaily magnesium
Men 19–30400 mg
Men 31+420 mg
Women 19–30310 mg
Women 31+320 mg
Pregnancy350–360 mg
Teens 14–18360–410 mg

The ODS notes that many people in the US get less magnesium from food than recommended, with older adults, people with type 2 diabetes, people with GI diseases like Crohn's or celiac disease, and people with alcohol dependence at higher risk of low levels.

Magnesium-rich foods for sleep and stress: the list

FoodServingApprox. magnesium
Pumpkin seeds, roasted1 ozabout 156 mg
Chia seeds1 ozabout 111 mg
Almonds, dry roasted1 ozabout 80 mg
Spinach, boiled½ cupabout 78 mg
Cashews, dry roasted1 ozabout 74 mg
Dark chocolate (70–85%)1 ozabout 65 mg
Peanuts¼ cupabout 63 mg
Soy milk1 cupabout 61 mg
Black beans, cooked½ cupabout 60 mg
Edamame, cooked½ cupabout 50 mg
Peanut butter2 tbspabout 49 mg
Baked potato with skin3.5 ozabout 43 mg
Brown rice, cooked½ cupabout 42 mg
Plain yogurt8 ozabout 42 mg
Oatmeal1 cup cookedabout 60 mg
Kidney beans, canned½ cupabout 35 mg
Banana1 mediumabout 32 mg
Salmon3 ozabout 26 mg
Avocado, cubed½ cupabout 22 mg

Notice the pattern: seeds, nuts, legumes, leafy greens, and whole grains. Refined grains lose most of their magnesium during processing, so switching from white to whole grains is one of the easiest upgrades.

A sample day with about 400 mg magnesium

MealFoodsApprox. magnesium
Breakfast1 cup oatmeal + 1 tbsp chia + banana125 mg
LunchBlack bean and brown rice bowl with spinach and avocado160 mg
Snack1 oz almonds80 mg
DinnerSalmon, baked potato, side of greens90 mg
Evening1 square dark chocolate (about ⅓ oz)20 mg
Total~475 mg

Evening snacks that include magnesium

If you like a small snack before bed, choose something light, low in sugar, and caffeine-conscious:

  1. Banana with a tablespoon of peanut butter (about 80 mg)
  2. A small handful of pumpkin seeds or almonds (75–150 mg)
  3. Plain yogurt with chia seeds (about 80 mg)
  4. Half a cup of oatmeal with milk (about 50 mg)
  5. Whole-grain toast with avocado (about 45 mg)
  6. Edamame, lightly salted (about 50 mg)

A note on dark chocolate: it's rich in magnesium but also contains caffeine and theobromine, so keep evening portions small if you're sensitive. Our guide on the best time to stop caffeine explains why timing matters.

Pair magnesium with real sleep and stress habits

Food is the foundation, but magnesium works best within a solid routine:

  • Keep consistent sleep and wake times. Our sleep hygiene checklist covers the essentials.
  • Wind down without screens for 30–60 minutes before bed.
  • Use breathing techniques to downshift your nervous system; try our breathing exercises for anxiety.
  • Offload racing thoughts with the strategies in how to stop overthinking before bed.
  • Move during the day. Regular exercise supports both sleep quality and stress resilience.
  • Limit alcohol, which disrupts sleep and increases magnesium loss through urine.

Easy ways to eat more magnesium every day

You don't need special recipes. A few small habits can add 100–200 mg a day:

  • Swap refined grains for whole grains: brown rice, oats, whole-wheat bread, and quinoa instead of white versions.
  • Keep a jar of mixed seeds (pumpkin, sunflower, chia) to sprinkle on salads, yogurt, soups, and oatmeal.
  • Add a can of beans to soups, salads, tacos, and pasta sauces two or three times a week.
  • Wilt a handful of spinach into eggs, curries, or pasta at the end of cooking.
  • Choose nuts as your default snack instead of chips or crackers.
  • Leave the skin on potatoes, where much of the magnesium sits.

These swaps also boost fiber, which supports steadier blood sugar, and stable blood sugar in the evening can make it easier to fall asleep without hunger or sugar crashes waking you up.

What about magnesium supplements?

Food sources of magnesium are safe; your kidneys remove excess. Supplements are different. The ODS sets an upper limit of 350 mg a day of supplemental magnesium for adults, as higher doses can cause diarrhea, nausea, and cramping, and very high intakes can be dangerous, especially for people with kidney disease. Magnesium supplements can also interact with certain antibiotics, osteoporosis medications, and diuretics. Talk with a doctor or pharmacist before starting one, especially if you take medication or have kidney problems.

Signs you might be low in magnesium

Early signs of low magnesium include loss of appetite, nausea, vomiting, fatigue, and weakness, according to the ODS. More severe deficiency can cause numbness, tingling, muscle cramps, seizures, and abnormal heart rhythms. True deficiency is uncommon in healthy people, but chronically low intake is common. MedlinePlus provides a good overview of magnesium's functions and food sources.

Bottom line

Magnesium-rich foods like pumpkin seeds, chia, almonds, spinach, beans, and whole grains help you meet a need many people miss, and that supports normal nerve, muscle, and sleep function. Don't expect a sedative effect; pair a magnesium-rich diet with a consistent sleep routine and stress-management habits. Explore more food-first guides in the Humantra nutrition hub.

Frequently asked questions

What food is highest in magnesium?

Pumpkin seeds are among the richest, with about 156 mg per ounce, followed by chia seeds, almonds, spinach, and cashews.

Does magnesium help you sleep?

Some small studies, mainly in older adults with insomnia, show modest benefits. It's most likely to help if you're low; it isn't a sedative.

What should I eat before bed for magnesium?

Try a banana with peanut butter, a handful of almonds or pumpkin seeds, yogurt with chia, or a small bowl of oatmeal.

Can magnesium reduce stress or anxiety?

Research is early and mixed. Meeting your needs through food supports normal nerve function, but it isn't a treatment for anxiety.

Can you get too much magnesium from food?

No, healthy kidneys remove excess magnesium from food. Supplements above 350 mg a day can cause diarrhea and other side effects.

Who is most at risk of low magnesium?

Older adults, people with type 2 diabetes, GI conditions like Crohn's or celiac disease, and alcohol dependence are at higher risk.

Medical disclaimer: This article is for general educational purposes only and is not medical advice, diagnosis, or treatment. Talk with a qualified healthcare professional before changing your exercise, diet, sleep, or mental-health routine—especially if you have a health condition, take medication, are pregnant, or are recovering from injury. Stop exercising and seek care if you feel chest pain, severe shortness of breath, dizziness, or sharp joint pain.

Sources

  1. NIH Office of Dietary Supplements. Magnesium Fact Sheet for Consumers
  2. Harvard T.H. Chan School of Public Health. Magnesium
  3. Abbasi B, et al. The effect of magnesium supplementation on primary insomnia in elderly. J Res Med Sci. 2012 (PubMed)
  4. MedlinePlus. Magnesium in diet
  5. Harvard T.H. Chan School of Public Health. Sleep