In Chinese patients with T2DM, metformin treatment was associated with a decreased risk of IDA admission, and this risk responded positively to the proportion of days covered by metformin. These findings suggest that metformin may have a pleiotropic effect on IDA in patients with type 2 diabetes. Our study has important clinical implications for the management of patients with diabetes and other conditions that increase the risk of IDA.