Brain Fog and Vitamin B12 Deficiency: What to Know

A common, testable and treatable cause of fog, more likely if you take metformin or long-term acid suppressants, eat no animal foods, or are older.

Of all the causes of brain fog, vitamin B12 deficiency may be the one with the best ratio of effort to payoff. It is common in specific groups, it is checked with an ordinary blood test, and it is treatable. It also tends to get missed, partly because it develops slowly and partly because its early symptoms (tiredness, poor concentration, a vague sense of being slower than usual) sound like ordinary life.

What B12 deficiency is

Vitamin B12 is needed to make red blood cells and to maintain the nervous system. The body absorbs it from animal foods through a multi-step process in the stomach and small intestine, and stores a supply in the liver that can last years. Deficiency usually comes from a problem with absorption rather than diet alone [1]. Common causes include pernicious anemia, an autoimmune condition that stops the stomach producing a protein needed for absorption; surgery on the stomach or small bowel; and gut conditions that affect the part of the intestine where B12 is absorbed.

Two medicines deserve a specific mention, because many people with brain fog take them.

  • Acid-suppressing medicines. In a case-control study of nearly 26,000 people diagnosed with B12 deficiency and more than 184,000 without, two or more years of proton pump inhibitor use was associated with 65% higher odds of deficiency [2]. Long-term H2 blockers showed a smaller association. The study was observational, so it shows a link rather than proof of cause, but the mechanism is plausible: stomach acid helps release B12 from food.
  • Metformin. In a long-term analysis of the Diabetes Prevention Program, low or borderline-low B12 was more common in people taking metformin, at 5 years (19.1% vs 9.5%) and at 13 years (20.3% vs 15.6%), and each year of use was associated with higher odds of deficiency [3].

Diet matters for people who eat no animal foods and don’t take a supplement or fortified foods [4]. Older adults are at higher risk too, partly because absorption declines with age.

How it produces brain fog

B12 is involved in making myelin, the insulation around nerves, and in pathways that affect brain chemistry. Deficiency can cause fatigue from anemia, and it can also cause neurological and cognitive symptoms directly: memory problems, difficulty concentrating, mood changes, numbness or tingling, and balance problems [1]. A clinically important point is that neurological symptoms can appear before anemia does, so a normal blood count does not rule out B12 deficiency.

How it’s diagnosed

A doctor will usually order a serum B12 level, often alongside a full blood count. B12 results in a borderline range are common and hard to interpret on their own; in that situation, measuring methylmalonic acid or homocysteine can help show whether the body is actually short of B12 [1]. If deficiency is confirmed, the next question is why, which may mean testing for pernicious anemia or looking at medicines and gut health.

If you take metformin or a long-term acid suppressant and have new fatigue or fog, it is reasonable to ask whether your B12 has been checked.

Treatment and what to expect

Treatment depends on the cause. People who can’t absorb B12 normally, such as those with pernicious anemia, are often treated with injections, at least at first. High-dose oral B12 can also work for many people, including some with absorption problems, because a small fraction is absorbed by a different route [1]. Blood counts usually improve over weeks. Nerve and cognitive symptoms may improve more slowly, and when they have been present for a long time they may not fully reverse, which is one reason not to put off testing.

What B12 does not appear to do is improve cognition in people who aren’t deficient. The NIH summary of the evidence notes that supplementation has not been shown to improve cognitive function in people with normal B12 levels [4]. Taking a B12 supplement for brain fog without a test treats a possible cause blindly, and it can mask the result if you’re tested later.

Do not stop metformin or an acid suppressant because of this article. Both are prescribed for good reasons. If B12 is low, the usual approach is to treat the deficiency and monitor, which your doctor can arrange.

What remains uncertain

The links between B12 and cognition in people with low-normal levels are less clear than in clear deficiency, and studies disagree about where to draw the line. The medicine studies above are observational and do not prove that the medicines caused every deficiency. And there is little research on how often B12 deficiency explains brain fog in younger adults specifically. Our reading is that this uncertainty is a reason to test, not to guess. For the broader list of what to rule out, see what causes brain fog, and for the closely related blood problem, brain fog and anemia.

If brain fog is new, persistent, or affecting daily life. See a doctor. Brain fog can be caused by conditions that are straightforward to treat once identified, including thyroid disorders, anemia, sleep apnea, and depression. A blood panel and a conversation with a GP is the first step, before any supplement.

Frequently asked questions

Can low vitamin B12 cause brain fog?

Yes. B12 deficiency can cause fatigue, poor concentration, memory problems and mood changes, and neurological symptoms can occur even before anemia shows up on a blood count. It is one of the common treatable causes of persistent brain fog that a blood test can check.

Who is most at risk of B12 deficiency?

Older adults, people with pernicious anemia, people who have had stomach or bowel surgery, people with conditions affecting the gut, vegans who don't take supplements, and people on long-term metformin or acid-suppressing medicines. In one large study, two or more years of proton pump inhibitor use was associated with 65% higher odds of B12 deficiency.

How is B12 deficiency tested?

A doctor usually orders a serum B12 level, often with a full blood count. When results are borderline, methylmalonic acid or homocysteine levels can help confirm deficiency. Testing for the cause, such as pernicious anemia, may follow.

Should I just take a B12 supplement for brain fog?

Get tested first. If you are deficient, the cause matters, because some causes need injections or further investigation. If you are not deficient, there is no good evidence that extra B12 improves cognition. Don't stop metformin or any prescribed medicine on your own; talk to your doctor.

Sources and further reading

  1. Stabler SP. Vitamin B12 deficiency

    Clinical review, New England Journal of Medicine, 2013;368(2):149-160. Causes, neurological and hematological features, diagnosis (including methylmalonic acid and homocysteine when B12 is borderline) and treatment with injections or high-dose oral B12.

  2. Lam JR, Schneider JL, Zhao W, Corley DA. Proton pump inhibitor and histamine 2 receptor antagonist use and vitamin B12 deficiency

    Case-control study, JAMA, 2013;310(22):2435-2442. 25,956 Kaiser Permanente Northern California patients with B12 deficiency vs 184,199 without. Two or more years' supply of PPIs was associated with deficiency (OR 1.65, 95% CI 1.58-1.73), as was two or more years of H2 blockers. Observational.

  3. Aroda VR, et al. Long-term metformin use and vitamin B12 deficiency in the Diabetes Prevention Program Outcomes Study

    Secondary analysis, Journal of Clinical Endocrinology & Metabolism, 2016;101(4):1754-1761. Adults at high risk of diabetes; low or borderline-low B12 was more common with metformin at 5 years (19.1% vs 9.5%) and 13 years (20.3% vs 15.6%). Each year of metformin use was associated with higher odds of deficiency (OR 1.13 per year).

  4. NIH Office of Dietary Supplements, Vitamin B12: Fact Sheet for Health Professionals

    NIH reference on vitamin B12: dietary sources, groups at risk of deficiency, signs and symptoms, testing, and evidence on supplementation and cognition.

Sources checked November 4, 2026. This is an editorial summary, not a systematic review or individual advice.

Get new articles by email

New articles from Fog Check, sent to your inbox. Unsubscribe at any time.

Related articles

Brain Fog and Gut Health: What the Evidence Shows

A review of the evidence connecting gut health to cognitive function, including the gut-brain axis, probiotics for cognition, and what the research actually supports for brain fog.

Brain Fog and Depression: What to Know

How depression causes cognitive symptoms, what the research shows about 'depressive brain fog,' and what treatment does (and does not) resolve.