Vitamin B12 (B12; also known as cobalamin) is a B vitamin that has an important role in cellular metabolism, especially in DNA synthesis, methylation and mitochondrial metabolism. Clinical B12 deficiency with classic haematological and neurological manifestations is relatively uncommon. However, subclinical deficiency affects between 2.5% and 26% of the general population depending on the definition used, although the clinical relevance is unclear. B12 deficiency can affect individuals at all ages, but most particularly elderly individuals. Infants, children, adolescents and women of reproductive age are also at high risk of deficiency in populations where dietary intake of B12-containing animal-derived foods is restricted. Deficiency is caused by either inadequate intake, inadequate bioavailability or malabsorption. Disruption of B12 transport in the blood, or impaired cellular uptake or metabolism causes an intracellular deficiency. Diagnostic biomarkers for B12 status include decreased levels of circulating total B12 and transcobalamin-bound B12, and abnormally increased levels of homocysteine and methylmalonic acid. However, the exact cut-offs to classify clinical and subclinical deficiency remain debated. Management depends on B12 supplementation, either via high-dose oral routes or via parenteral administration. This Primer describes the current knowledge surrounding B12 deficiency, and highlights improvements in diagnostic methods as well as shifting concepts about the prevalence, causes and manifestations of B12 deficiency.