Caffeine does cause a short, measurable spike in magnesium lost through urine, but for most people who drink coffee at normal levels, the effect is modest rather than depleting. The safest move if you rely on magnesium for sleep or muscle recovery is simple: take your supplement in the evening, well away from your strongest coffee of the day, rather than alongside it.
TL;DR:
- Drinking coffee causes only a modest, short-term increase in magnesium loss for most people, especially with moderate intake.
- A typical cup supplies about 7mg of magnesium, which is a small fraction of the daily recommended intake, making coffee a negligible magnesium source.
- Timing magnesium supplements for the evening or spacing them two hours away from coffee reduces interactions and supports better absorption.
- Regular caffeine consumption blunts magnesium excretion spikes, so habitual drinkers face less risk of depletion than occasional consumers.
- People at higher risk of magnesium deficiency, such as athletes or those on certain medications, should monitor symptoms and consult a doctor if issues persist.
Table of Contents
- Does caffeine deplete magnesium? The mechanism and timescale
- How much magnesium does coffee actually give you back?
- What does the clinical evidence actually show?
- How should you time magnesium around your coffee?
- Who is most at risk of low magnesium, and when should you see a doctor?
- Getting magnesium timing right as a runner
- A sensible middle ground, not a reason to panic
- Ready: an evening magnesium routine built for runners
- Sources
- FAQ
Does caffeine deplete magnesium? The mechanism and timescale
Yes, but the effect is time-limited and dose-dependent. Caffeine acts as a mild diuretic, and part of that fluid loss carries magnesium out with it through the kidneys.
The mechanism is not simply “more urine, more magnesium”. Research on caffeine’s effect on urinary magnesium excretion shows the kidneys actually reabsorb less magnesium back into the bloodstream after a caffeine dose, which is a distinct process from fluid loss. That reduced reabsorption is what drives the extra mineral loss, not dehydration alone.
The timing matters more than most people assume:
- Increased urinary magnesium excretion typically starts within an hour of a caffeine dose and can persist for up to six hours.
- The studies behind this used an acute dose of roughly 6 mg per kilogram of body weight, which for a 70kg adult works out to around 420mg of caffeine, well above a single flat white.
- Tolerance blunts the response. Regular coffee drinkers show a smaller excretion spike than someone who rarely touches caffeine and then has a strong double espresso.
So a single big coffee on an empty stomach behaves differently in your body than the same coffee sipped as part of a daily three-cup habit.
How much magnesium does coffee actually give you back?
Coffee is not a meaningful magnesium source, even though it contains a small amount of the mineral. A typical cup supplies roughly 7mg of magnesium, which covers only a small fraction of the reference intake for most adults.
Quick fact: One cup of coffee provides around 7mg of magnesium, a small fraction of what an average adult needs in a day, while the caffeine in that same cup can nudge urinary losses upward for several hours afterwards.
Brew strength and bean type shift that number slightly. A stronger cold brew or a dark roast espresso can edge marginally higher, but the variation is small enough that it doesn’t change the practical conclusion: coffee is not a magnesium strategy, it’s a mild net drain when consumed in large single doses, and roughly neutral at normal levels.
What does the clinical evidence actually show?
The strongest data comes from acute-dosing trials rather than long-term population studies, and that gap matters when judging how worried to be.
- A dose around 6 mg per kilogram of body weight has repeatedly produced a measurable rise in urinary magnesium excretion within hours of intake.
- A broader review of coffee’s effects on mineral status found the response is inconsistent across studies, with dose and habitual tolerance both changing the size of the effect.
- Electrolyte-balance research on caffeine shows the same pattern extends to sodium and potassium, but concludes that moderate intake, around 2 to 3 cups a day, rarely produces clinically relevant losses in healthy adults.
What’s missing is long-term, real-world evidence tracking habitual coffee drinkers’ magnesium status over months or years rather than hours. That evidence gap is exactly why the NIH’s Office of Dietary Supplements frames caffeine as one contributing factor among several, not a standalone cause of deficiency, and why cautious, practical timing advice fills a genuine gap rather than overreacting to thin data.
How should you time magnesium around your coffee?
You don’t need to give up coffee to protect your magnesium levels. You need a routine that keeps the two apart at the moments when the interaction is strongest.
- Favour evening supplementation. Taking magnesium at night, hours after your last coffee, sidesteps the peak excretion window entirely and supports the kind of deeper, uninterrupted sleep runners rely on for recovery.
- If you must take it during the day, leave a gap. Two hours either side of a strong coffee is a sensible, conservative buffer, similar to the separation rule used for magnesium and iron.
- Build magnesium into meals rather than relying on supplements alone. Leafy greens, pumpkin seeds, almonds, and dark chocolate all contribute meaningfully, and pairing magnesium with food can improve how much your body actually absorbs.
- Choose a well-tolerated form. Magnesium bisglycinate tends to sit more gently on the stomach than magnesium oxide or citrate, and organic salt forms are generally considered marginally more bioavailable.
- Stay ahead of fluid loss. Extra water on days with higher caffeine intake, particularly around exercise, helps offset the diuretic effect on magnesium and other electrolytes.
Pro Tip: Splitting your daily magnesium into two smaller doses, rather than one large one, tends to improve overall absorption compared with a single big dose, according to research on magnesium bioavailability, so consider a smaller morning dose (well clear of coffee) plus your main evening dose.
Who is most at risk of low magnesium, and when should you see a doctor?
Certain groups face a genuinely higher risk than the average coffee drinker, and it’s worth knowing whether you’re one of them.
- People on diuretics, proton pump inhibitors, or other medicines that increase renal or gastrointestinal losses.
- Anyone with malabsorption conditions, heavy alcohol use, or poorly controlled diabetes.
- Endurance athletes and heavy sweaters, including runners training through summer heat.
- People combining high caffeine intake with a genuinely low-magnesium diet, rather than just moderate coffee drinkers.
Watch for muscle cramps, twitching, persistent fatigue, or an irregular heartbeat. Hypomagnesemia is confirmed by a blood test, with normal serum levels sitting roughly between 0.66 and 1.07 MMOs/L, so if cramps or fatigue persist despite dietary changes, ask a GP for testing rather than guessing with supplements alone.
Getting magnesium timing right as a runner
For runners, the coffee and magnesium question usually comes down to protecting sleep and next-day recovery. A practical routine looks like this: morning or pre-run coffee as normal, then magnesium taken in the evening, ideally an hour or two before bed, well clear of any late caffeine.
Magnesium bisglycinate is the form most commonly chosen for this evening slot because it’s gentle on the stomach and doesn’t tend to cause the loose-stool effect some cheaper magnesium salts do. It’s a practical fit for a routine, not a clinical claim.
If you’re on medication that affects kidney function, take diuretics, or notice persistent cramping despite these changes, speak to a GP before adjusting your supplement dose.

A sensible middle ground, not a reason to panic
The honest read of the evidence is that caffeine and magnesium have a real but modest interaction for most moderate drinkers, and the fix is timing, not abstinence. Enjoy your coffee, stagger your supplement into the evening, and get your magnesium checked by a GP if cramps or fatigue don’t shift once you’ve tightened up your routine.
— Tim
Ready: an evening magnesium routine built for runners
A magnesium bisglycinate capsule designed for an evening routine can help ensure your supplement does not compete with your morning or pre-run coffee for absorption.

Ready is UK made, filler free, and suitable for vegetarians and vegans, with a straightforward capsule format rather than powders or fizzy tablets to mix. It comes with a 30-day guarantee, and you can buy it as a one-off purchase or through the Subscribe & Save plan if you’d rather not think about reordering. If cramps, poor sleep, or slow recovery have you wondering whether your magnesium and caffeine habits are working against each other, Ready is a straightforward place to start.
This article is general information, not a substitute for advice from a qualified doctor. Consult a qualified healthcare professional about your own circumstances before acting on anything here.
Sources
- The effect of caffeine on urinary magnesium excretion.
- Coffee and minerals: a review of the literature (PMC review).
- Hypomagnesemia — MedlinePlus Medical Encyclopedia.
- Magnesium in human nutrition and health (PMC review).
FAQ
Can I take caffeine and magnesium together?
Yes, but separating them by a couple of hours, or taking magnesium in the evening, reduces any overlap with caffeine’s short window of increased urinary magnesium loss.
What shouldn’t be taken with magnesium?
High-dose caffeine and iron supplements are the two most commonly flagged interactions, since both can reduce how much magnesium your body retains or absorbs when taken close together.
Is magnesium OK to take with lamotrigine?
Magnesium supplements aren’t known to have a major interaction with lamotrigine, but anyone on epilepsy or mood-stabilising medication should confirm timing and dosage with their prescribing doctor before adding a supplement.
What are the signs your body needs magnesium?
Common signs include muscle cramps or twitching, persistent fatigue, poor sleep, irritability, and in more serious cases, an irregular heartbeat, and a blood test is the only reliable way to confirm low levels.
Does coffee count towards my daily magnesium intake?
Barely. A typical cup provides only around 7mg, a small fraction of daily needs, so it’s not a food you should rely on for magnesium.