By Dr. Nada Ahmed El Gazaar, BPharm. Last reviewed November 22, 2026.
Magnesium takes part in hundreds of reactions in the body, including muscle and nerve function and blood sugar control. Most people get it from seeds, nuts, beans, whole grains and leafy greens. Below are the best sources with the amount per serving from the NIH Office of Dietary Supplements, a sample day, and the medicine interactions most articles leave out.
How much magnesium do you need?
| Group | Recommended daily amount (mg) |
|---|---|
| Children 4 to 8 years | 130 |
| Children 9 to 13 years | 240 |
| Teen boys 14 to 18 | 410 |
| Teen girls 14 to 18 | 360 |
| Men 19 to 30 | 400 |
| Men 31 and over | 420 |
| Women 19 to 30 | 310 |
| Women 31 and over | 320 |
| Pregnancy, 19 to 30 / 31 to 50 | 350 / 360 |
15 magnesium rich foods ranked
| Rank | Food | Serving | Magnesium (mg) |
|---|---|---|---|
| 1 | Pumpkin seeds, roasted | 1 oz | 156 |
| 2 | Chia seeds | 1 oz | 111 |
| 3 | Almonds, dry roasted | 1 oz | 80 |
| 4 | Spinach, boiled | 1/2 cup | 78 |
| 5 | Cashews, dry roasted | 1 oz | 74 |
| 6 | Peanuts, oil roasted | 1/4 cup | 63 |
| 7 | Soy milk, plain | 1 cup | 61 |
| 8 | Black beans, cooked | 1/2 cup | 60 |
| 9 | Edamame, shelled, cooked | 1/2 cup | 50 |
| 10 | Peanut butter, smooth | 2 tbsp | 49 |
| 11 | Baked potato with skin | 3.5 oz | 43 |
| 12 | Brown rice, cooked | 1/2 cup | 42 |
| 13 | Plain low fat yoghurt | 8 oz | 42 |
| 14 | Banana | 1 medium | 32 |
| 15 | Salmon, Atlantic, farmed, cooked | 3 oz | 26 |
Easy swaps that add magnesium
| Instead of | Try | Extra magnesium (mg) |
|---|---|---|
| White rice, 1/2 cup | Brown rice, 1/2 cup | Adds the 42 mg listed above |
| A snack of crackers | 1 oz pumpkin seeds | 156 |
| Breakfast cereal alone | Yoghurt with 1 oz chia | About 153 with the yoghurt |
| Side of lettuce | 1/2 cup boiled spinach | 78 |
A sample day: 434 mg
| Meal | Foods | Magnesium (mg) |
|---|---|---|
| Breakfast | 8 oz plain yoghurt, 1 oz chia, 1 banana | 185 |
| Lunch | 1/2 cup black beans, 1/2 cup brown rice, 1/2 cup boiled spinach | 180 |
| Dinner | 3 oz salmon, 1 baked potato with skin | 69 |
| Total | 434 |
Magnesium for women, kids and sleep
Women need less than men in the NIH tables, 310 to 320 mg for most adults, and 350 to 360 mg in pregnancy. Children need far less, from 130 mg at ages 4 to 8, so a small handful of seeds on yoghurt goes a long way for them.
Magnesium is often marketed for sleep. A 2021 systematic review and meta analysis by Mah and Pitre in BMC Complementary Medicine and Therapies looked at magnesium supplements for insomnia in older adults and found the evidence to be low quality, so food is a safe way to meet your needs but not a proven sleep treatment.
What the evidence cannot tell you
- Food amounts vary with soil, variety and cooking, so every number above is an approximation.
- Boiling vegetables can lose some magnesium into the water.
- Blood tests measure only a small fraction of the body’s magnesium, so a normal result does not rule out a low intake.
- Supplements are not the same as food, and the NIH upper limit of 350 mg a day applies to supplements and medicines, not to food.
The pharmacist check: medicines and magnesium
| Medicine | What happens | What to do |
|---|---|---|
| Bisphosphonates (alendronate, risedronate) | Magnesium rich foods and supplements can reduce absorption. | Follow the leaflet and keep the gap the NIH recommends, at least 2 hours. |
| Tetracycline and quinolone antibiotics | Magnesium binds the antibiotic and lowers its effect. | Take the antibiotic well before or after magnesium; ask your pharmacist for the exact timing. |
| Loop and thiazide diuretics | Increase magnesium loss in urine. | Mention fatigue, cramps or palpitations to your doctor. |
| Potassium sparing diuretics (spironolactone, amiloride) | Reduce magnesium loss. | Do not add magnesium supplements without advice. |
| Proton pump inhibitors, long term | The NIH notes prolonged use may cause low magnesium. | Ask whether your levels need checking. |
When to see a doctor
See a doctor for muscle cramps that will not settle, an irregular heartbeat, severe diarrhea, or kidney disease, since people with kidney problems can build up magnesium.
Frequently asked questions
What food is highest in magnesium?
Roasted pumpkin seeds, with about 156 mg per ounce, are the highest among common foods in the NIH table.
How much magnesium do I need a day?
The NIH recommends 400 mg for men aged 19 to 30, 420 mg for men 31 and over, 310 mg for women 19 to 30 and 320 mg for women 31 and over.
Can I get enough magnesium from food?
Most people can, using seeds, nuts, beans, whole grains and leafy greens. A sample day in this article reaches 434 mg.
Does magnesium help sleep?
A 2021 meta analysis of supplements in older adults rated the evidence as low quality, so it is not a proven sleep aid.
Do magnesium foods interact with medicines?
Supplements matter more than food, but bisphosphonates and some antibiotics need spacing from magnesium.
Is it possible to have too much magnesium from food?
Food is rarely the problem. The 350 mg upper limit refers to supplements and medicines, and kidney disease raises the risk.
Sources
- NIH Office of Dietary Supplements: Magnesium fact sheet for health professionals
- Mah and Pitre 2021, BMC Complementary Medicine and Therapies, magnesium supplementation for insomnia in older adults
Related reading: vegan protein sources, high fiber breakfast foods, bedtime snacks for blood sugar and the most nutrient dense foods.

