BackgroundTotal knee arthroplasty are among the most frequently conducted surgeries, due to an aging society. Since hospital costs are subsequently rising, adequate preparation of patients and reimbursement becomes more and more important. Recent literature revealed anemia as a risk factor for enhanced length of stay (LOS) and complications. This study analyzed whether preoperative hemoglobin (Hb) and postoperative Hb were associated with total hospital costs and general ward costs.MethodsThe study comprised 367 patients from a single high-volume hospital in Germany. Hospital costs were calculated with standardized cost accounting methods. Generalized linear models were applied to account for confounders, such as age, comorbidities, body mass index, insurance status, health-related quality of life, implant types, incision-suture-time and tranexamic acid.ResultsPreoperative anemic women had 426 Euros higher general ward costs (p < 0.01), due to increased LOS. For men, 1 g/dl less Hb loss between the preoperative value and the value before discharge reduced total costs by 292 Euros (p < 0.001) and 161 Euros fewer general ward costs (p < 0.001). Total hospital costs were reduced by 144 Euros with 1 g/dl higher Hb on day 2 postoperatively for women (p < 0.01).ConclusionPreoperative anemia was associated with increased general ward costs for women and Hb loss with decreasing total hospital costs for men and women. Cost containment, especially reduced utilization of the general ward, may be feasible with the correction of anemia for women. Postoperative Hb values may be a factor for adjustments of reimbursement systems.Level of evidenceRetrospective cohort study, III.Supplementary InformationThe online version contains supplementary material available at 10.1007/s00402-023-04929-4.