Why magnesium matters
Magnesium is a mineral your body uses every day. MedlinePlus says it supports more than 300 biochemical reactions in the body, helping to maintain nerve and muscle function, immune health, a steady heartbeat and strong bones.
You cannot store large amounts, so you need a regular supply from food.
Most people who eat a varied diet get enough. A low intake is more likely when meals are mostly refined foods and few vegetables, beans, nuts or whole grains.
MedlinePlus lists early signs of low magnesium as loss of appetite, nausea, vomiting and tiredness, and notes that more serious deficiency is uncommon and usually linked to other health problems. If you are worried, talk to your doctor instead of guessing.
Build meals that include these foodsHow much magnesium do you need?
Different countries publish different figures. The NHS says adults aged 19 to 64 need 300 mg a day (men) and 270 mg a day (women).
MedlinePlus, reflecting US guidance, lists 400 mg a day for men aged 19 to 30 and 420 mg for men aged 31 and older, and 310 mg for women aged 19 to 30 and 320 mg for women aged 31 and older.
- UK (NHS): 300 mg (men) and 270 mg (women).
- US (MedlinePlus): 400 to 420 mg (men) and 310 to 320 mg (women).
- Supplements: the NHS says 400 mg or less a day from supplements is unlikely to cause harm, and that taking more than 400 mg for a short time can cause diarrhea.
You do not need to hit an exact number. A varied diet with regular greens, nuts, beans and whole grains usually covers it.
If you take medicines or have kidney or other health conditions, ask your doctor what is right for you.
Want an easy way to build these foods into meals?
The Healthy Eating Guide shows how to combine vegetables, protein and whole grains at every meal.
Foods 1 to 3: Spinach and leafy greens, nuts, and seeds
The NHS names spinach and nuts among the main magnesium sources. MedlinePlus says dark green leafy vegetables are primary sources, and lists almonds and cashews, and seeds, among other sources.
- Add spinach to omelets, soups and pasta.
- Toss leafy greens into salads.
- Keep a small handful of almonds or cashews as a snack.
- Sprinkle seeds over yogurt, oatmeal and salads.
Nuts and seeds are also high in calories, so small portions are enough.
Foods 4 to 6: Wholegrains, beans and lentils, and tofu
The NHS lists wholemeal bread as a magnesium source. MedlinePlus lists whole grains such as brown rice, legumes and soy products like tofu.
- Choose wholemeal bread, brown rice and oats.
- Add beans, chickpeas and lentils to soups, curries and salads.
- Cook tofu in stir-fries or scrambles.
Whole grains and beans also provide fiber. See our article on fiber-rich foods.
Foods 7 to 10: Bananas, avocados, dried apricots and milk
MedlinePlus lists bananas, dried apricots and avocados among fruits with magnesium, and includes milk as a source.
- Slice a banana onto oatmeal or toast.
- Add avocado to sandwiches and salads.
- Snack on a few dried apricots.
- Have milk or yogurt with breakfast, if you eat dairy.
Dried fruit is sweet and easy to overeat, so keep portions modest.
A sample day with magnesium-rich foods
- Breakfast: oatmeal with banana, seeds and milk.
- Lunch: lentil and spinach soup with wholemeal bread.
- Snack: a small handful of almonds and a few dried apricots.
- Dinner: tofu and vegetable stir-fry with brown rice.
This adds a mix of magnesium sources across the day, without any special products.
For more planning ideas, see our guide to weekly meal planning.
Magnesium supplements and safety
Magnesium supplements are sold widely. Most people do not need them.
The NHS says the Department of Health and Social Care advises that having 400 mg or less a day of magnesium from supplements is unlikely to cause harm, and that taking more than 400 mg for a short time can cause diarrhea. Long-term effects of high doses remain unclear.
MedlinePlus notes that toxicity from food is rare, and that too much usually comes from supplements or from laxatives that contain magnesium. It is a particular concern for people with kidney disease.
- Talk to your doctor before you start.
- Count magnesium from food and from other products, such as some laxatives and antacids.
- Do not exceed the label dose.
This article is general education, not personal dietary or medical advice. Its reviewer, Meena Narayanan, holds a personal training credential, which is not a dietetics or medical credential. Talk to your doctor or a registered dietitian before you change your diet or take supplements, especially if you have a health condition, take medicines, are pregnant or are older.
Eating these foods on a budget
You do not need expensive products to get magnesium. Everyday foods do the job, and many are cheap.
The NHS says fresh, frozen, canned and dried fruit and vegetables all count toward your 5 A DAY, so frozen and canned options are good value and keep for longer.
- Buy dried or canned beans and lentils.
- Choose oats, brown rice and wholemeal bread.
- Buy frozen spinach and other frozen greens.
- Buy seeds and nuts in larger bags, and portion them out.
- Choose bananas and seasonal fruit.
Plan your meals for the week and write a shopping list. Our guide on weekly meal planning shows how, and it also cuts food waste.
Read labels on canned foods for added salt or sugar, and rinse canned beans and vegetables where suitable.
A simple seven-day plan
Add one small change each day, and keep the earlier ones going. By the end of the week you will have several new habits.
- Day 1: add a handful of spinach to lunch.
- Day 2: swap white bread or rice for wholemeal or brown.
- Day 3: have beans or lentils for dinner.
- Day 4: snack on almonds or cashews.
- Day 5: add seeds to yogurt or oatmeal.
- Day 6: try tofu in a stir-fry.
- Day 7: have a banana or avocado, and review the week.
You do not need to follow this plan exactly. Use it as a guide and swap foods for ones you enjoy, can afford and can get locally.
Aim for progress, not perfection. If a day goes off plan, start again the next day.
Tips for vegetarians and vegans
Magnesium is easy to get on a plant-based diet. Leafy greens, nuts, seeds, legumes, whole grains and tofu are all listed by MedlinePlus as sources, and many plant-based diets include them often.
If you avoid all animal foods, it can be worth talking to a registered dietitian to check your overall nutrient intake, including calcium, vitamin B12 and vitamin D.
Common mistakes to avoid
- Relying on supplements. Food provides a mix of nutrients, and most people do not need supplements.
- Taking high doses. The NHS says more than 400 mg from supplements for a short time can cause diarrhea.
- Ignoring kidney health. People with kidney disease should ask their doctor before taking magnesium.
- Eating too many refined grains. Choose whole grains more often, as the NIDDK suggests.
- Hoping for a quick fix. Magnesium will not fix poor sleep, stress or tiredness on its own.
A varied diet with regular vegetables, beans, nuts and whole grains covers most people's needs.
A magnesium-friendly shopping list
- Greens: spinach, kale, salad leaves.
- Nuts and seeds: almonds, cashews, pumpkin or sunflower seeds.
- Grains: oats, brown rice, wholemeal bread and pasta.
- Legumes: lentils, chickpeas, kidney beans.
- Other: tofu, bananas, avocados, dried apricots, milk or yogurt.
Fill your basket with mostly whole, minimally processed foods, and you will cover magnesium along with plenty of other nutrients.
Also remember to buy water and herbal teas, since drinks matter too. Our guide on the benefits of drinking enough water explains why.
Common questions
Does magnesium help you sleep?
You may see claims online. We have not found reliable evidence in the sources we reviewed, so we do not make that claim. Sleep habits such as a steady schedule and a calm bedroom are better supported. See our five ways to improve sleep quality.
Do I need magnesium after exercise?
A balanced diet usually supplies what you need. If you have muscle cramps often, speak to your doctor, since cramps have many possible causes.
Can I get too much from food?
This is very unlikely. Excess usually comes from supplements or certain medicines.
Recap: the main points
- Magnesium supports many body processes, including nerves, muscles and bones.
- Adults need about 270 to 300 mg a day in the UK, and about 310 to 420 mg in US guidance.
- Good sources include leafy greens, nuts, seeds, beans, whole grains, tofu, bananas, avocados, dried apricots and milk.
- Supplements above 400 mg a day may cause diarrhea, and kidney disease needs extra care.
- Talk to your doctor before taking supplements.
Magnesium-rich foods: frequently asked questions
Dark green leafy vegetables such as spinach, nuts such as almonds and cashews, seeds, beans and lentils, whole grains, tofu, bananas, avocados, dried apricots and milk.
The NHS says 300 mg for men and 270 mg for women aged 19 to 64. US guidance lists 400 to 420 mg for men and 310 to 320 mg for women.
Most people who eat a varied diet can. Choose leafy greens, nuts, seeds, beans and whole grains regularly.
The NHS says 400 mg or less a day from supplements is unlikely to cause harm. More than 400 mg for a short time can cause diarrhea. Talk to your doctor first.
MedlinePlus lists early signs as loss of appetite, nausea, vomiting and tiredness. See a doctor if you are concerned.
People with kidney disease and those taking certain medicines. Ask your doctor before taking supplements.
Want the full picture? Read our Healthy Eating Guide.
Sources and further reading
We checked the figures and guidance in this article against these sources. This article does not give personal medical advice.
- NHS: Other vitamins and minerals (magnesium, potassium and more)
- MedlinePlus: Magnesium in diet
- NHS: Eight tips for healthy eating
Want more? Head back to the Nutrition hub or read the Start Here guides.