What is the ICD‑10‑CM code for vitamin B12 deficiency (including both anemia and non‑anemic forms)?

Medical Advisory BoardAll articles are reviewed for accuracy by our Medical Advisory Board
Educational purpose only • Exercise caution as content is pending human review
Article Review Status
Submitted
Under Review
Approved

Last updated: February 23, 2026View editorial policy

Personalize

Help us tailor your experience

Which best describes you? Your choice helps us use language that's most understandable for you.

ICD-10-CM Codes for Vitamin B12 Deficiency

The ICD-10 code for vitamin B12 deficiency is D51, which encompasses all forms of vitamin B12 deficiency anemia. 1

Primary Code Structure

  • D51 is the root code for vitamin B12 deficiency anemia in ICD-10-CM, covering both pernicious anemia and other forms of cobalamin deficiency with anemia. 1

Important Clinical Context for Coding Accuracy

Diagnostic Accuracy Concerns

  • The positive predictive value of the D51 code in administrative databases is only 31.5-36.8% when validated against biochemical confirmation of B12 deficiency with anemia, meaning this code is frequently misapplied in clinical practice. 2
  • When B12 deficiency without anemia is used as the reference standard, the PPV improves to 51.3%, but this still represents substantial coding inaccuracy. 2
  • The PPV is significantly lower (22.2%) in patients actually receiving B12 supplementation compared to those not supplemented (63.9%), suggesting the code is often applied inappropriately to patients already treated or without true deficiency. 2

Clinical Definitions for Proper Code Application

  • Only 18.9% of patients with documented vitamin B12 deficiency meet WHO criteria for pernicious anemia (Hb <13 g/dL for men or <12 g/dL for women, MCV ≥100 fL, serum B12 <200 pg/mL, and positive gastric parietal cell antibodies). 3
  • Among B12-deficient patients, 38.9% have anemia by hemoglobin criteria, 41.1% have macrocytosis (MCV ≥100 fL), and 47.8% have positive gastric parietal cell antibodies, but these features do not always overlap. 3

Coding Guidance Based on Clinical Presentation

When D51 is Appropriate

  • Use D51 when the patient has confirmed vitamin B12 deficiency (serum B12 <180 pg/mL or <150 pmol/L) AND documented anemia (Hb <13 g/dL for men, <12 g/dL for women). 1, 4
  • The code applies regardless of whether the deficiency is due to pernicious anemia, dietary insufficiency, malabsorption, or medication-induced causes. 4, 5

When Alternative Coding May Be Needed

  • For patients with biochemically confirmed B12 deficiency (low serum B12, elevated methylmalonic acid >271 nmol/L) but without anemia, consider that D51 may not accurately capture the clinical scenario, as this code specifically denotes deficiency anemia. 1, 2
  • Up to 50% of patients with metabolic B12 deficiency have normal serum B12 levels but elevated methylmalonic acid, representing functional deficiency that may not be captured by standard coding. 1

Common Clinical Pitfalls in B12 Deficiency Coding

  • Neurological manifestations of B12 deficiency often appear before hematological changes, so patients may have severe neurological symptoms (paresthesias, ataxia, cognitive impairment) without meeting anemia criteria for D51. 4, 6
  • Macrocytosis (MCV ≥100 fL) precedes anemia development and is often the earliest laboratory sign, but macrocytosis alone without anemia may not warrant the D51 code. 1
  • Food-bound cobalamin malabsorption is now the most common cause of B12 deficiency, not pernicious anemia, yet the coding system does not distinguish between etiologies. 6

High-Risk Populations Requiring Screening

  • Adults >75 years (18.1% have metabolic deficiency), metformin use >4 months, PPI or H2-blocker use >12 months, gastric/intestinal resection, inflammatory bowel disease, and strict vegetarians/vegans all warrant screening. 1, 5
  • Post-bariatric surgery patients have permanent B12 malabsorption requiring lifelong supplementation. 1, 5

References

Guideline

Vitamin B12 and Magnesium Deficiency Diagnosis

Praxis Medical Insights: Practical Summaries of Clinical Guidelines, 2026

Research

Do all the patients with vitamin B12 deficiency have pernicious anemia?

Journal of oral pathology & medicine : official publication of the International Association of Oral Pathologists and the American Academy of Oral Pathology, 2016

Guideline

Vitamin B12 Deficiency Diagnosis and Treatment

Praxis Medical Insights: Practical Summaries of Clinical Guidelines, 2026

Research

Vitamin B12 Deficiency: Recognition and Management.

American family physician, 2017

Research

Vitamin B12 deficiency - A 21st century perspective .

Clinical medicine (London, England), 2015

Related Questions

What is the clinical significance of distinguishing pernicious anemia from other causes of vitamin B12 deficiency, such as post-bariatric surgery malabsorption, in terms of management and patient outcomes?
How long should I give 1500 micrograms (mcg) of vitamin B12 daily for anemia?
What is the appropriate treatment for a vegan patient with vitamin B12 deficiency, presenting with fatigue, nausea, pallor, and glossitis, and having a low serum vitamin B12 level and mild anemia?
What is the management plan for a 76-year-old female with a normal vitamin B12 level of 229 pg/mL?
What is the recommended treatment for a 60-year-old female with vitamin B12 deficiency (hypocobalaminemia), normal Complete Blood Count (CBC) results, and an elevated Red Blood Cell (RBC) count?
Which specialist should evaluate a one‑week‑old chemical burn of the scalp?
What is the recommended treatment regimen for an otherwise healthy adult with acute herpes zoster?
How can I explain mild cardiomegaly to a patient in a reassuring, non‑alarming manner?
What is the recommended salbutamol (albuterol) dose and administration schedule for a child with wheeze, including weight‑based nebulised dosing for infants and older children, MDI with spacer dosing for different age groups, and adjustments for severe exacerbations?
After the initial incision and drainage of an abscess, I feel a firm, hard area under the skin; could this represent the residual abscess cavity (sac)?
In a patient with a high‑titer speckled antinuclear antibody (1:640) and negative anti‑double‑stranded DNA and extractable nuclear antigen panels, what does a borderline low complement component 3 (80 mg/dL) and markedly low complement component 4 (10 mg/dL) indicate and how should it be managed?

Professional Medical Disclaimer

This information is intended for healthcare professionals. Any medical decision-making should rely on clinical judgment and independently verified information. The content provided herein does not replace professional discretion and should be considered supplementary to established clinical guidelines. Healthcare providers should verify all information against primary literature and current practice standards before application in patient care. Dr.Oracle assumes no liability for clinical decisions based on this content.

Have a follow-up question?

Our Medical A.I. is used by practicing medical doctors at top research institutions around the world. Ask any follow up question and get world-class guideline-backed answers instantly.