rationTracker

Magnesium: What It Does, How Much You Need, and Where to Get It

A look at the mineral behind hundreds of body processes, from sleep to muscle function.

Want to see how much magnesium you actually get? Track it free with Ration →

By the Ration Editorial Team · Reviewed against primary research · Updated July 14, 2026

Key takeaways

  • Magnesium supports muscle, nerve, blood sugar, and bone function throughout the body
  • Many people fall short of recommended intakes, though severe deficiency is rare
  • Leafy greens, nuts, seeds, legumes, and whole grains are reliable food sources
  • Supplements come in many forms; some absorb better and cause less stomach upset than others

What is magnesium?

Magnesium is an essential mineral, meaning the body cannot make it and needs a steady supply from food or supplements.

It works as a cofactor for hundreds of enzymes involved in energy production, protein synthesis, and DNA repair.

Most of the body's magnesium is stored in bone and soft tissue, with only a small fraction circulating in blood.

What does magnesium do in the body?

Magnesium helps regulate muscle contraction and nerve signaling, working alongside calcium and potassium to keep those systems balanced.

It also plays a role in blood sugar control, blood pressure regulation, and the structural development of bone.

Because it touches so many systems, low magnesium status has been studied in relation to a wide range of conditions.

What happens if you don't get enough?

Mild, ongoing shortfalls are more common than a diagnosed deficiency, especially among people who eat few vegetables, legumes, or whole grains.

Early signs some people report include muscle cramps, fatigue, and irritability, though these symptoms overlap with many other causes.

More pronounced deficiency, which is uncommon in otherwise healthy people, can affect heart rhythm and nerve function.

Where does magnesium come from in food?

Magnesium is widespread in plant foods, particularly anything grown in mineral-rich soil, along with nuts, seeds, and legumes.

Whole grains keep more magnesium than refined grains, since much of it is lost in processing.

Magnesium, mg per 100 grams
  1. 1Rice Bran Crude781 mg / 100 g
  2. 2Seeds Cottonseed Meal760 mg / 100 g
  3. 3Seeds Cottonseed Flour719 mg / 100 g
  4. 4Seeds Hemp Seed700 mg / 100 g
  5. 5Chives Freeze-Dried640 mg / 100 g
  6. 6Wheat Bran Crude611 mg / 100 g
  7. 10Seeds Cottonseed Kernels440 mg / 100 g
Ranked by magnesium per 100 grams (so dense, dry foods like flours rank high). Computed live from the Ration database.

Dark leafy greens like spinach, along with almonds, pumpkin seeds, black beans, and avocado, are all reliable everyday sources.

Does magnesium help you sleep?

Magnesium is popularly marketed as a sleep aid, and its role in calming nerve activity gives this idea some biological plausibility.

That said, the evidence specifically for magnesium supplements improving sleep quality in the general population remains limited and mixed, and much of the enthusiasm outpaces the data currently available.

People considering magnesium for sleep should treat it as an open question rather than a settled fix.

How much magnesium do you need?

Recommended intakes vary by age and sex, generally landing higher for adult men than for adult women.

What forms do magnesium supplements come in?

Magnesium supplements are sold bound to different compounds, and the form can affect absorption and tolerability.

Is magnesium safe?

Magnesium from food sources carries no known risk of toxicity in healthy people, since the kidneys clear excess amounts.

Supplemental magnesium, particularly at high doses, can cause diarrhea, nausea, and abdominal cramping, since unabsorbed magnesium draws water into the intestines.

People with reduced kidney function are at higher risk of magnesium buildup and should be more cautious with supplements.

The bottom line

Magnesium is a workhorse mineral involved in muscle function, nerve signaling, blood sugar control, and bone health.

A varied diet rich in leafy greens, nuts, seeds, legumes, and whole grains covers most people's needs without any supplement.

For specific claims like better sleep or fewer muscle cramps, it is fair to stay curious but not oversold, since the research is still developing.

Frequently asked questions

What are the best food sources of magnesium?

Leafy greens, nuts, seeds, legumes, whole grains, and avocado are among the most concentrated everyday sources.

Can magnesium supplements help with sleep?

Some people report better sleep with magnesium, but current evidence for the general population is limited and mixed, so it should not be treated as a proven fix.

Who is most likely to be low in magnesium?

Older adults, people with digestive conditions, people with type 2 diabetes, and those on certain long-term medications are at higher risk of falling short.

What is the difference between magnesium citrate and magnesium glycinate?

Magnesium citrate is well absorbed and commonly used, while magnesium glycinate is often chosen by people looking for a gentler effect on the stomach.

Can you take too much magnesium?

Excess magnesium from food is not a concern for healthy people, but high-dose supplements can cause diarrhea and, in rare cases involving kidney disease, more serious effects.