Metformin use is associated with cobalamin (vitamin B12) deficiency. However, the influence of both duration and dose of metformin is unclear. Studies using holotranscobalamin, a marker for cellular cobalamin deficiency, are scarce. We therefore investigated the prevalence of cobalamin deficiency in type 2 diabetes patients using both markers, and its relation with duration and dose of metformin use. This cross-sectional study among 550 type 2 diabetes patients using metformin (mean daily dose 1,306 mg; mean duration 64 months) was conducted in four primary care centers in Utrecht, the Netherlands. Cobalamin and holotranscobalamin concentrations were measured at the annual diabetes check. Detailed information on metformin use and confounding variables was collected from medical records. The prevalence of a cobalamin deficiency was 28.1 %, while a holotranscobalamin deficiency occurred in 3.9 % of the patients. Adjusting for multiple confounders, a 1 mg/day increase in daily metformin dose was associated (p < 0.001) with 0.042 (95 % CI −0.060, −0.023) decrease in cobalamin concentrations. Similarly, a 10 g increase of cumulative metformin dose was associated (p = 0.006) with −0.070 (−0.12, −0.021) lower cobalamin concentrations after adjustment for confounders. Duration of metformin use was not associated with cobalamin concentrations after multivariable adjustment. Similar results were observed for holotranscobalamin. Cobalamin deficiency occurs frequently among diabetes patients using metformin. A higher daily and cumulative doses of metformin were strongly associated with lower cobalamin and holotranscobalamin concentrations, while duration was not. It is thus important to account for metformin dose in recommendations for screening for cobalamin deficiency.