If you have been told to give up coffee because of your Afib, you are far from alone.
For decades, cutting out caffeine was recommended for people with heart rhythm conditions. The thinking was straightforward: caffeine stimulates the heart, so it might provoke abnormal rhythms.
However, research over the past two decades has challenged this assumption, and a recent randomized clinical trial found that avoiding caffeine did not reduce Afib episodes in habitual coffee drinkers. Instead, participants experienced the expected withdrawal symptoms, such as headaches and reduced alertness.
Key takeaways
-
Blanket avoidance of caffeine is not supported by current evidence for most people with Afib: multiple large prospective studies fail to find a harmful association between habitual moderate coffee consumption and Afib risk.
-
The DECAF trial, a randomized crossover study, found that continuing coffee consumption did not increase Afib burden, and that stopping abruptly was associated with a modest increase in episodes.
-
Caffeine blocks adenosine, a molecule that can itself trigger Afib in some people; this partly explains why caffeine is not universally harmful to heart rhythm.
-
Individual sensitivity is real and varies by genetics: some people do experience consistent episode onset with caffeine, and for them, reduction is appropriate. Energy drinks carry a distinct risk profile from moderate coffee consumption and should not be treated as equivalent.
-
The 2024 ESC Guidelines support an individualized approach, not universal restriction.
-
Tracking caffeine intake and timing alongside Afib episodes is the most direct way to determine whether it is a personal trigger for you.
Magnesium comes up often in Afib communities. Some people say it has helped them; others have tried it for months and noticed nothing.
The truth is that magnesium does play a real role in heart function, and there are specific clinical situations where its use is well supported. But the idea that taking a daily magnesium supplement will prevent or reduce Afib episodes in most people is not backed by strong enough evidence to make it a formal recommendation.
Here is a clear look at what the research currently shows and where the gaps still are.

Why magnesium matters for the heart
Magnesium is a mineral that the body needs for hundreds of biological processes. In the heart, it plays two particularly important roles. First, it helps power something in heart cells called the sodium-potassium pump, a protein that keeps the electrical balance in the cell stable. When magnesium levels are low, this pump works less effectively, the cell becomes less stable electrically, and the threshold for abnormal rhythms is lowered.
Magnesium deficiency has been linked to Afib risk factors such as high blood pressure, while magnesium supplementation has been associated with lower cholesterol and reduced risk of type 2 diabetes. That said, larger studies specifically on magnesium supplements are still needed before firm conclusions can be drawn.
Where the evidence for magnesium is strongest
In the hospital: Heart rate control during rapid Afib
When Afib causes the heart to beat very rapidly, the main priority is to bring the heart rate down quickly. Magnesium given directly into a vein, in a hospital setting, has been shown to help with this. It works by slowing the speed at which electrical signals pass from the upper chambers of the heart (the atria) to the lower chambers (the ventricles), which brings the heart rate down.
A study that pooled data from large trials found that magnesium was significantly more effective than a placebo at bringing the heart rate down quickly during rapid Afib (a specific type of Afib where the lower chambers beat abnormally fast), and also increased the likelihood of the heart converting back to a normal rhythm when used alongside standard antiarrhythmic medications. This is why intravenous magnesium (injected straight into the bloodstream) is commonly used in emergency departments for people with rapid Afib, and the evidence for this use is fairly well established.
After cardiac surgery: Preventing new Afib
Developing Afib in the days after heart surgery, a complication called postoperative Afib (POAF), is one of the most common problems following procedures such as coronary artery bypass surgery or valve replacement. It can mean a longer hospital stay and additional complications. Magnesium levels commonly drop during and after surgery, and correcting this depletion may help protect the heart during the vulnerable recovery period. A meta-analysis that analyzed 22 randomized trials found that giving magnesium intravenously around the time of heart surgery reduced the occurrence of postoperative Afib by roughly a third compared with no supplementation. A newer study from 2025 found that across 24 clinical trials involving more than 3,300 people undergoing heart surgery, magnesium treatment reduced the risk of developing postoperative atrial fibrillation by 30-45%.
Where the evidence is weaker
Daily oral magnesium supplements
Evidence for taking daily oral magnesium supplements to reduce Afib episodes is much weaker than the evidence for intravenous magnesium used around heart surgery. A pilot trial of oral magnesium oxide supplementation (400 mg of magnesium oxide) also found no significant reduction in Afib burden or risk factors (blood pressure and blood sugar), although the study mainly evaluated feasibility rather than clinical efficacy. Digestive side effects were common too, affecting around half of the people taking the supplement.
Additionally, a 2023 review of multiple studies, with a total of 4,713 participants, also found that magnesium supplementation did not meaningfully reduce the chance of developing Afib compared with people who received none. The dose and form of magnesium administered varied between studies, as well as the duration of cardiac monitoring.
This area has simply not been studied enough yet to draw reliable conclusions.
Low magnesium levels and Afib risk
While the evidence for supplementation is limited, there is consistent observational evidence that people who have low magnesium levels in their blood, or who consume less magnesium through their diet, have a higher incidence of Afib over time. A study using data from the ARIC study (Atherosclerosis Risk in Communities) which followed over 14,000 people over many years, found that higher dietary magnesium intake was linked to a lower risk of developing Afib.
This does not mean that taking a supplement will reduce your risk if your levels are already normal. But it does suggest that getting enough magnesium through your diet is worth paying attention to.
Magnesium type might matter more than we think
There's a growing theory that the type of magnesium you take could matter a lot for Afib management, not just whether you take it. Some people with Afib have reported that specific forms, magnesium glycinate or taurate in particular, seem to help more with managing their episodes than other forms do.
Worth being upfront about this: it's still an anecdotal pattern at this point, not something backed by real clinical trials. It's a genuinely interesting area to watch, but not yet something to treat as established guidance.
Who is at risk of low magnesium?
Some groups are particularly likely to have low magnesium levels and may genuinely benefit from supplementation or dietary attention. People taking diuretics (water tablets), commonly prescribed for high blood pressure or heart failure, excrete more magnesium through the kidneys. People who drink alcohol heavily lose magnesium through a similar mechanism. Those with type 2 diabetes, certain gut conditions that affect absorption, or a diet low in green leafy vegetables, nuts, seeds, and whole grains may also have insufficient intake. If any of that sounds like you, it may be worth asking your doctor to check your magnesium .
What the guidelines say
The 2024 ESC atrial fibrillation guidelines recommend identifying and correcting electrolyte imbalances (electrolytes are minerals the body uses to carry electrical signals, and magnesium is one of them), particularly in people taking diuretics. What the guidelines do not recommend is routine supplementation for people with normal magnesium levels, as there is not yet enough evidence to support that.
How MyAfib fits in
Supplements are among the hardest things to evaluate through personal experience alone. Any effect tends to be gradual and is easy to confuse with the natural variation in Afib frequency. If you have ever wondered whether what you are taking is actually making a difference, tracking your supplement intake consistently alongside your heart rate and Afib episodes in MyAfib over several weeks gives you a much more objective basis for working that out. It will not replace a clinical trial, but it is the most honest way to see what is happening for you.
As always, speak with your healthcare provider before making any changes to your treatment or routine.
What we still do not know
The main gap in the evidence is that there are no large, well-designed trials testing oral magnesium supplements specifically for reducing Afib episodes in people living with the condition day to day. The most effective dose and form of magnesium are also not yet known.
It is unclear whether any benefit would only apply to people with low magnesium levels, or whether it might also help those whose levels are already normal. In addition, how magnesium interacts with common Afib medications, such as beta-blockers, calcium channel blockers, and antiarrhythmic drugs, has not been properly studied.
More research is needed before clear recommendations can be made.