Objective In the era of fast track surgery, early and accurately estimating whether postoperative length of stay (p-LOS) will be prolonged after lung cancer surgery is very important, both for patient's discharge planning and hospital bed management. Pulmonary function tests (PFTs) are very valuable routine examinations which should not be underutilized before lung cancer surgery. Thus, this study aimed to establish an accurate but simple prediction tool, based on PFTs, for achieving a personalized prediction of prolonged p-LOS in patients following lung resection. Methods The medical information of 1257 patients undergoing lung cancer surgery were retrospectively reviewed and served as the training set. p-LOS exceeding the third quartile value was considered prolonged. Using logistic regression analyses, potential predictors of prolonged p-LOS were identified among various preoperative factors containing PFTs and intraoperative factors. A nomogram was constructed and subjected to internal and external validation. Results Five independent risk factors for prolonged p-LOS were identified, including older age, being male, and ratio of residual volume to total lung capacity (RV/TLC) ≥ 45.0% which is the only modifiable risk factor, more invasive surgical approach, and surgical type. The nomogram comprised of these five predictors exhibited sufficient predictive accuracy, with the area under the receiver operating characteristic curve (AUC) of 0.76 [95% confidence interval (CI) 0.73-0.79] in the internal validation. Also its predictive performance remained fine in the external validation, with the AUC of 0.70 (95% CI 0.60-0.79). The calibration curves showed satisfactory agreements between the model predicted probability and the actually observed probability. Conclusions Preoperative amelioration of RV/TLC may prevent lung cancer patients from unnecessary prolonged p-LOS. The integrated nomogram we developed could provide personalized risk prediction of prolonged p-LOS. This prediction tool may help patients perceive expected hospital stays and enable clinicians to achieve better bed management after lung cancer surgery.