The aim of the study was to develop an algorithm to predict postoperative pneumonia among elderly patients with lung cancer after video-assisted thoracoscopic surgery. We analyzed 3,009 patients from the Thoracic Perioperative Database for Geriatrics in our hospital and finally enrolled 1,585 elderly patients (age≧65 years) with lung cancer treated with video-assisted thoracoscopic surgery. The included patients were randomly divided into a training group (n = 793) and a validation group (n = 792). Patients in the training group were used to develop the algorithm after screening up to 30 potential risk factors, and patients in the validation group were used to internally validate the algorithm. External validation of the algorithm was achieved in the external validation dataset after enrolling 165 elderly patients with lung cancer treated with video-assisted thoracoscopic surgery from two hospitals in China. Of all included patients, 9.15% (145/1,585) of patients suffered from postoperative pneumonia in the Thoracic Perioperative Database for Geriatrics, and 10.30% (17/165) of patients had postoperative pneumonia in the external validation dataset. The algorithm consisted of seven variables, including sex, smoking, history of chronic obstructive pulmonary disease (COPD), surgery duration, leukocyte count, intraoperative injection of colloid, and intraoperative injection of hormone. The C-index from the receiver operating characteristic curve (AUROC) was 0.70 in the training group, 0.67 in the internal validation group, and 0.71 in the external validation dataset, and the corresponding calibration slopes were 0.88 (95% confident interval [CI]: 0.37–1.39), 0.90 (95% CI: 0.46–1.34), and 1.03 (95% CI: 0.24–1.83), respectively. The actual probabilities of postoperative pneumonia were 5.14% (53/1031) in the low-risk group, 15.07% (71/471) in the medium-risk group, and 25.30% (21/83) in the high-risk group (p < 0.001). The algorithm can be a useful prognostic tool to predict the risk of developing postoperative pneumonia among elderly patients with lung cancer after video-assisted thoracoscopic surgery.