Quick answer: not in any meaningful way for most people. Caffeine slightly increases the amount of magnesium (and calcium) you pass in urine for a few hours after drinking it, but the effect is small, and brewed coffee itself contains a little magnesium, about 7 mg per cup. Moderate coffee drinking, up to around 400 mg of caffeine a day for healthy adults, hasn’t been shown to cause magnesium deficiency. Low magnesium is more often linked to poor diet, heavy alcohol use, diabetes and certain medicines.

How caffeine affects magnesium
Caffeine has a mild diuretic effect, and small studies show it briefly raises urinary losses of magnesium, calcium and sodium. Regular coffee drinkers build up some tolerance to this effect, and the extra loss is a few milligrams, compared with a daily need of 310 to 420 mg. If your diet contains enough magnesium, this is easily covered.
Does coffee block magnesium absorption?
There’s little evidence that coffee blocks magnesium absorption from food in a way that matters. Coffee and tea do reduce absorption of non-heme iron when drunk with meals, which is a better-documented effect. If you take a magnesium supplement, taking it with food or water rather than with coffee is a simple precaution.

Who is more likely to be low in magnesium?
- People with type 2 diabetes
- People who drink alcohol heavily
- Older adults
- People with digestive conditions such as Crohn’s or celiac disease
- People taking long-term proton pump inhibitors or some diuretics
If you fit one of these groups and drink a lot of coffee, it’s worth paying more attention to magnesium in your diet. Signs of low magnesium include muscle cramps, weakness, tiredness and, in more serious cases, abnormal heart rhythms; a doctor can check your levels.
How much magnesium do you need?
Adult men need 400 to 420 mg a day and women 310 to 320 mg. Many Americans eat less than this. Good sources include pumpkin seeds (about 156 mg per ounce), chia seeds, almonds, spinach, cashews, black beans, edamame, peanut butter, whole grains and dark chocolate. See our list of foods high in magnesium.
Tips for coffee drinkers
- Keep caffeine to about 400 mg a day (roughly four 8-ounce cups of brewed coffee) or less, and less during pregnancy.
- Eat magnesium-rich foods every day; a handful of nuts or seeds goes a long way.
- Drink water as well as coffee.
- Take magnesium supplements with food, not with your coffee, if you use them.
Related reading
- Magnesium: how much you need and the best sources
- Best time to take magnesium
- How long does magnesium stay in your body?
- How long after taking iron can you drink coffee?
Free · every two weeks
One surprising mineral fact, every two weeks
Like why bananas are slightly radioactive, or why your frying pan might be a supplement. Plain English, checked against NIH and USDA data. No hype.
Free. Unsubscribe any time. We never share your email. Privacy policy