Globally, hip fractures in elderly individuals are a prevalent and serious issue. Patients typically have a longer length of stay (LOS), which increases the risk of complications and increases hospitalization costs. Hemoglobin (Hb) is a routine blood test that is associated with disease prognosis. This study aimed to investigate the relationship between preoperative Hb and LOS in elderly hip fracture patients and to determine a reliable transfusion threshold. The clinical data of hip fracture patients (aged ≥ 60 years) admitted to the Department of Orthopaedics, Shenzhen Second People’s Hospital, between January 2012 and December 2021 were retrospectively analyzed. Multiple linear regression analysis was used to assess the linear relationship between preoperative Hb and LOS. Smooth curve fitting was performed to investigate potential nonlinear relationships. In the case of discovering nonlinear relationships, a weighted two-piecewise linear regression model was built, and the inflection points were determined using a recursive algorithm. Subgroup analyses were conducted based on age and gender. A total of 1444 patients with an average age of (77.54 ± 8.73) years were enrolled. After adjusting for covariates, a nonlinear relationship was found between preoperative Hb and LOS. The two-piecewise linear regression model revealed an inflection point of 10 g/dL. On the left of the inflection point (Hb < 10 g/dL), the LOS was reduced by 0.735 days for every 1 g/dL increase in Hb (β = ‐0.735, 95% confidence interval: ‐1.346 to ‐0.124, P = .019). On the right side of the inflection point (Hb > 10 g/dL), the relationship was not statistically significant (β = 0.001, 95% confidence interval: ‐0.293 to 0.296, P = .992). In elderly hip fracture patients, there is a nonlinear association between preoperative Hb and LOS. However, when Hb levels were <10 g/dL, there was a negative correlation with the LOS. No correlation was observed when Hb levels were >10 g/dL. These findings underscore the importance of timely intervention to manage Hb levels in elderly patients with hip fractures, potentially reducing hospitalization durations and associated complications.