You can eat
- Plain almonds or cashews as part of a snack.
- Pumpkin seeds or sesame seeds sprinkled over a salad.
- Chickpeas, lentils or beans in everyday meals.
- Oats, wholemeal bread or brown rice, according to your appetite.
- Cooked spinach or chard as a side dish.
- A little dark chocolate if you enjoy it, without treating it as a main source.
What to avoid
- Taking magnesium supplements on your own, especially if you have kidney disease.
- Using laxatives or antacids containing magnesium without medical advice.
- Taking several magnesium products at once without adding up their amounts.
- Using refined bread, rice and pasta as the basis of every meal.
- Treating milk chocolate or chocolates as a “source of magnesium”.
Changes that help
Snack
Instead of pastries, try plain yoghurt with a handful of almonds, which adds magnesium and makes the snack more filling.
Rice side dish
Instead of having white rice every day, alternate it with brown rice, because whole grains retain more magnesium.
Simple salad
Instead of having salad on its own every time, add cooked chickpeas to provide magnesium and turn the side dish into a more substantial meal.
Habits that help
- If you suspect a deficiency, review your regular medication with your doctor.
- Note when cramps occur and what training you did that day.
- Make a note of magnesium-containing products you take and how much each provides.
Magnesium comes up often in consultations, usually with a practical question: should you get it from food or take it separately? We start with food and consider a supplement only when there is a specific reason.
What is magnesium for?
Magnesium is involved in processes that allow the body to use energy from food. It also plays a part in muscle and nerve function and is part of the structure of bone [1]. Taking more than you need does not, by itself, improve performance or bone health.
A practical way to get enough is to eat a variety of food groups throughout the week. A chickpea and seed salad or porridge made with oats and almonds can contribute magnesium without treating any one food as a remedy.
If your question is about bone health during menopause or symptoms related to the menstrual cycle, each topic has its own guide.
Which foods provide the most magnesium per serving?
Typical servings put the figures in context. This table estimates the magnesium in each portion using BEDCA values per 100 g [2]. These are approximate amounts; products and preparation methods can vary.
| Food | Suggested serving | Approximate magnesium |
|---|---|---|
| Pumpkin seeds | 30 g | 178 mg |
| Sesame seeds | 15 g | 53 mg |
| Raw almonds | 30 g | 77 mg |
| Boiled chickpeas | 180 g | 95 mg |
| Raw oats | 40 g | 71 mg |
| Boiled spinach | 150 g | 70 mg |
| Dark chocolate with sugar | 20 g | 21 mg |
Chocolate provides magnesium, but the serving is small. Pulses and whole grains, which are eaten in larger amounts, contribute more over the course of the day [2].
How much magnesium is needed each day?
The European Food Safety Authority sets an indicative daily reference intake for the population [1]. For adults, it is 350 mg a day for men and 300 mg for women. The reference remains 300 mg during pregnancy and breastfeeding [1].
| Life stage | Daily magnesium reference |
|---|---|
| 7–11 months | 80 mg |
| 1 to under 3 years | 170 mg |
| 3 to under 10 years | 230 mg |
| 10 to under 18 years: girls / boys | 250 / 300 mg |
| Adults: women / men | 300 / 350 mg |
| Pregnancy and breastfeeding | 300 mg |
These are indicative references for daily food intake. They are not a reason to give magnesium supplements to children or pregnant people without professional assessment.
Who may be at risk of magnesium deficiency?
Clinical deficiency is uncommon in healthy people who eat enough. According to the US National Institutes of Health, the risk is higher with malabsorption, type 2 diabetes, high alcohol consumption, persistently low magnesium intake or older age [3]. Some diuretics increase magnesium losses; long-term use of proton pump inhibitors may also lower magnesium levels [3].
Early symptoms, such as loss of appetite, nausea or weakness, are not specific [3]. That is why we consider diet, medication and clinical context before drawing conclusions. If you take one of these medicines, talk to the prescriber; do not stop it based on this information.
What is the relationship between magnesium, sport and cramps?
Training requires adequate energy and nutrients from your diet. According to the Australian Institute of Sport, magnesium supplements have not been shown to improve performance in trained athletes who already eat enough [4]. If you train a lot and eat too little, we first assess whether your eating plan provides what you need.

Cramps during exercise do not prove that you have a magnesium deficiency: the Cochrane review found no trials testing magnesium for exercise-associated cramps [5]. You can find what is known about cramps in our guide to foods high in potassium.
For help planning meals before and after training, see our sports nutrition guide.
How much magnesium from supplements is safe?
A magnesium supplement should be recommended by your doctor or dietitian-nutritionist after considering your diet, symptoms, medication and kidney function. If there is a cause of deficiency, identifying it is part of the decision. If you have fibromyalgia, our guide reviews what is known about magnesium and other supplements. See “Magnesium after 60”.
The European table of upper limits sets a limit for added magnesium for people aged 4 and over, including pregnant and breastfeeding people [6]. No such limit has been established for children under 4 [6]. It applies to salts and compounds in supplements, water or fortified foods, not to magnesium naturally present in food [6].
At high doses, magnesium from supplements, laxatives or antacids can cause diarrhoea and other digestive symptoms [3]. If you have kidney disease, any product containing magnesium needs medical assessment before use [3]. Do not add up the amounts in several products or medicines on your own.
Can it help with sleep, anxiety or migraine?
For better sleep, a recent review of trials found inconsistent results and low-certainty evidence. It does not support routine use of magnesium as a treatment for insomnia [7]. In mild anxiety, another review found promising results, especially in people with low levels, but called for larger, more consistent trials before a recommendation can be established [8].
For migraine, a meta-analysis of trials found fewer migraine attacks and migraine days per month with magnesium supplements [9]. If you are already receiving treatment, consult your doctor. A supplement should be recommended by your doctor or dietitian-nutritionist. Eating foods that contain magnesium is not the same as the intervention studied.
Questions we are asked about magnesium in consultations
The most common question is whether one isolated cramp is enough to diagnose magnesium deficiency. It is not. We review what you eat over the week, what medication you take and whether there is a cause that needs medical attention.
We also see labels that advertise magnesium without making clear how much a serving provides. Compare the stated daily amount with the upper limit for added magnesium [6], and bring the packaging to your appointment if you need help interpreting it.
A meal with pulses, nuts or seeds provides magnesium and other nutrients. Eating these foods regularly matters more than pursuing one particular food.
Start by looking at what you eat over the course of the week.
If you would like to review your diet or have questions about a possible deficiency, our metabolic health nutrition team can help in Barcelona or online, coordinating with your doctor when needed.
Your first step this week
A meal with pulses
Make a chickpea dish this week and save another serving for a day when you have less time.
When to see a doctor
When to seek advice before taking a supplement
Magnesium from food does not treat cramps, insomnia or migraine. If your symptoms persist or you have been taking diuretics or stomach-protecting medicines for a long time, consult your doctor before adding a supplement.
If you have kidney disease, magnesium from supplements, laxatives or antacids can build up. The warning signs that call for a medical appointment are covered in our diet guide for chronic kidney disease.

Tell us what your week looks like and what you would like to change
At the first visit we talk about your schedule, who cooks at home and what you have tried before. At the second visit you receive your plan in writing.
Keep reading

Fibromyalgia diet: what to eat and what may help
Almost everything hurts, you have no energy, and every week someone tells you to cut out which food.…

Sports nutrition: what to eat for training, competition and recovery
You train seriously, eat as well as you can, and do not know whether what you carry in…

Legumes: benefits, serving sizes and how to digest them more easily
Legumes are highly nutritious and inexpensive. Even so, many people find them heavy, get gas or are unsure…

Medicinal plants: why natural does not mean safe
An infusion to help you sleep, capsules for digestion, something from the herbal shop: it seems harmless because…

Magnesium in perimenopause: benefits, types and when it may be needed
Tiredness, sleep, cramps and bones: what we know about magnesium in perimenopause and when it may make sense…
ConsultationDietitian to help you eat better in Barcelona and online
Learn to eat better, with shopping, menus and cooking that fit your week and no lists of foods…
Book a visit →
Sources
- EFSA NDA Panel. Scientific Opinion on Dietary Reference Values for magnesium. EFSA Journal. 2015;13(7):4186. doi:10.2903/j.efsa.2015.4186.
- BEDCA Network and Spanish Agency for Food Safety and Nutrition. Spanish Food Composition Database: entries for pumpkin seeds, sesame, raw almonds, boiled chickpeas, raw oats, boiled spinach and dark chocolate with sugar. BEDCA, version 1.0; 2010. https://www.bedca.net/.
- National Institutes of Health, Office of Dietary Supplements. Magnesium: Fact Sheet for Health Professionals. NIH; publication date not stated, accessed 2026. https://ods.od.nih.gov/factsheets/Magnesium-HealthProfessional/.
- Australian Institute of Sport. Magnesium: summary of supporting evidence. Australian Sports Commission; publication date not stated, accessed 2026. .
- Garrison SR, Korownyk CS, Kolber MR, et al. Magnesium for skeletal muscle cramps. Cochrane Database of Systematic Reviews. 2020;9:CD009402. doi:10.1002/14651858.CD009402.pub3.
- European Food Safety Authority. Overview on Tolerable Upper Intake Levels as derived by the Scientific Committee on Food and the EFSA Panel on Dietetic Products, Nutrition and Allergies. Summary of Tolerable Upper Intake Levels, version 11. EFSA; 2025. https://www.efsa.europa.eu/sites/default/files/2024-05/ul-summary-report.pdf.
- Lopresti AL, Smith SJ, Drummond PD. Magnesium Supplementation for Sleep in Adults: A Systematic Review of Randomized Controlled Trials. Journal of Dietary Supplements. 2026;23(5):553-581. doi:10.1080/19390211.2026.2719670.
- Rawji A, Peltier MR, Mourtzanakis K, et al. Examining the Effects of Supplemental Magnesium on Self-Reported Anxiety and Sleep Quality: A Systematic Review. Cureus. 2024;16(4):e59317. doi:10.7759/cureus.59317.
- Karami Talandashti M, Shahinfar H, Delgarm P, et al. Effects of selected dietary supplements on migraine prophylaxis: A systematic review and dose-response meta-analysis of randomized controlled trials. Neurological Sciences. 2025;46(2):651-670. doi:10.1007/s10072-024-07794-0.
Written and reviewed by

How we can help
Now, applied to you
Dietitian to help you eat better in Barcelona and onlineLearn to eat better, with shopping, menus and cooking that fit your week and no lists of foods you can't have, in Barcelona and online.
4.9 on Google · 5.0 on Doctoralia · 2,072 reviews







