What Causes B12 Deficiency: Diet, Meds & More

Vitamin B12 deficiency happens when your body can’t get enough B12 from food, can’t absorb it properly, or has its existing stores depleted by a chemical or medical condition. The causes range from dietary gaps to autoimmune disease to common medications you might already be taking. Because your liver stores several years’ worth of B12, deficiency often develops slowly and can be well underway before symptoms appear.

A serum B12 level below 200 pg/mL is considered deficient, while levels between 200 and 300 pg/mL fall into a borderline range that may need further testing. Above 300 pg/mL is normal. Understanding what drove your levels down is key to fixing the problem, because the treatment for a dietary shortfall looks very different from the treatment for an absorption disorder.

Diet: The Most Straightforward Cause

B12 is found almost exclusively in animal products: meat, fish, eggs, and dairy. Plant-based foods do not contain a reliable source of the vitamin. This makes strict vegans especially vulnerable. One analysis found that 52% of vegan individuals had deficient B12 levels, compared to just 1% of omnivores. A European study comparing dietary groups reported even more striking numbers: 92% of vegans and 77% of lacto-ovo vegetarians had deficient levels, versus 11% of omnivores.

Some vegans try to get B12 from seaweed, kombucha, or other fermented foods, but research consistently shows these sources fall short. People relying on them had the lowest levels of the active, usable form of B12 in their blood. If you eat little or no animal food, a dedicated B12 supplement or fortified foods (like certain plant milks and nutritional yeast) are the only reliable options.

Your liver can store enough B12 to last roughly three to six years even if you stop consuming it entirely. That long buffer is why someone who goes vegan might feel fine for years before deficiency sets in, and why the problem can sneak up on you.

Pernicious Anemia and Autoimmune Gastritis

Pernicious anemia is an autoimmune condition in which your immune system attacks the parietal cells in the stomach lining. These cells have two important jobs: producing stomach acid and producing intrinsic factor, a protein that binds to B12 and carries it to the part of the small intestine where it gets absorbed. When parietal cells are destroyed, both functions decline. Less acid means B12 can’t be freed from the proteins in food, and less intrinsic factor means whatever B12 does get released has no way to enter your bloodstream.

Some people with pernicious anemia also develop antibodies that directly block intrinsic factor from binding to B12, creating a second layer of interference. Pernicious anemia is found in up to 25% of patients with autoimmune gastritis, a condition that attacks the acid-producing part of the stomach while leaving other regions intact. Because the absorption pathway is physically impaired, people with pernicious anemia typically need B12 injections rather than oral supplements.

Stomach Acid Loss With Aging

Even without an autoimmune diagnosis, the stomach naturally produces less acid as you get older. The underlying condition, atrophic gastritis, becomes remarkably common with age. Autopsy data shows it affects about 7% of people under 50, jumps to 21% of those between 51 and 70, and reaches nearly 48% of people over 70. That means roughly one in every two adults past age 70 has meaningful thinning of their stomach lining.

When atrophy affects the body of the stomach (the corpus), it directly impairs both acid secretion and intrinsic factor production, the same two functions lost in pernicious anemia but through gradual wear rather than immune attack. This is a major reason why B12 deficiency is so common in older adults, even those who eat plenty of meat and dairy.

Crohn’s Disease and Intestinal Surgery

B12 is absorbed in a very specific location: the terminal ileum, the last stretch of the small intestine. Any condition that inflames or damages this area can block absorption. Crohn’s disease is the most common culprit, since it frequently targets the terminal ileum.

Active inflammation in the terminal ileum nearly quadruples the odds of B12 deficiency. Surgical removal of that section raises the risk further, and the risk scales with how much tissue is taken. Resection of 20 cm or less triples the odds; resection of more than 20 cm increases them nearly sevenfold. Celiac disease can also contribute, though it primarily affects the upper small intestine and is a less direct cause.

Common Medications

Two widely prescribed drug categories are linked to B12 depletion, and millions of people take them daily.

Metformin, the first-line medication for type 2 diabetes, interferes with B12 absorption through several overlapping mechanisms. It alters the movement of the intestines in ways that encourage bacterial overgrowth, disrupts the intrinsic factor pathway, and interferes with a calcium-dependent step in B12 uptake. The longer you take metformin, the greater the risk.

Proton pump inhibitors (PPIs), used for acid reflux and ulcers, work by dramatically reducing stomach acid. That’s their purpose, but it also means B12 can’t be properly freed from the proteins in food. Long-term PPI use, generally defined as a year or more, is associated with meaningfully lower B12 levels. When metformin and a PPI are taken together, the combined effect on B12 can be greater than either drug alone.

H. Pylori Infection

Helicobacter pylori, the bacterium responsible for most stomach ulcers, can also quietly drive B12 levels down. The infection damages the stomach lining and disrupts acid production, making it harder for B12 to separate from food proteins, the essential first step in absorption. Research published in JAMA Internal Medicine found that treating the infection successfully improved both anemia and B12 levels in 40% of infected patients who were B12-deficient. Because H. pylori infection is extremely common worldwide and often goes undiagnosed for years, it may be an underrecognized contributor to low B12.

Nitrous Oxide Exposure

Nitrous oxide, commonly known as laughing gas, chemically inactivates B12 inside the body. It doesn’t just block absorption; it destroys B12 that’s already stored and working. The gas displaces B12 from one of the two enzymes that depend on it, converts functional B12 into unusable analogue forms, and reduces the active form of B12 in the liver by 20 to 60%. Recovery of enzyme activity is slow even after exposure stops.

A single session of nitrous oxide during dental work is unlikely to cause problems in someone with normal B12 stores. The real danger is recreational use, where repeated or prolonged inhalation can trigger severe neurological symptoms, sometimes within days to weeks. People who already have borderline B12 levels are at particular risk, because they have less reserve to absorb the hit.

Overlapping Risk Factors

In practice, B12 deficiency often results from more than one cause stacking up. An older adult on a PPI who also has mild atrophic gastritis is losing B12 from multiple angles simultaneously. A person with Crohn’s disease who also takes metformin for diabetes faces compounded risk. Recognizing which factors apply to you helps explain why your levels dropped and determines whether oral supplements will work or whether you need a different route of replacement, like injections that bypass the gut entirely.