ABSTRACT: OBJECTIVE:Postoperative atrial fibrillation (POAF) is common after anatomic thoracic surgery. Elevated preoperative brain natriuretic peptide (BNP) level is strongly associated with risk of POAF. We describe the development and internal validation of a clinical prediction model for POAF that includes BNP and other clinical factors. METHODS:Clinical and preoperative BNP data were collected for 635 patients in sinus rhythm before anatomic lung (n = 540) or esophageal (n = 95) resection. The primary outcome was new onset of POAF (>5 minutes) during hospitalization. A prediction model was developed using multivariable logistic regression analysis and internally validated using a bootstrap-resampling approach. RESULTS:POAF occurred in 20% of patients (124 out of 635). BNP level was higher among patients with than without POAF (median, 45 vs 23 pg/mL; P < .0001). The final prediction model included 5 factors: age (odds ratio [OR], 1.05; 95% confidence interval [CI], 1.02-1.08; P = .001), body mass index (OR, 1.05; 95% CI, 1.00-1.09; P = .016), BNP level (75th vs 25th percentile, 57.5 vs 12.5 pg/mL; OR, 2.08; 95% CI, 1.26-3.43; P = .0003), history of atrial fibrillation (OR, 5.91; 95% CI, 2.47-14.11; P < .0001), and extent of surgery (compared with segmentectomy [reference]: pneumonectomy OR, 6.70; 95% CI, 1.91-24.70; esophagectomy OR, 4.93; 95% CI, 1.94-14.06; lobectomy OR, 1.88; 95% CI, 4.90-8.34; overall P = .0002). The model had good calibration and discrimination (C statistic, 0.736). After internal validation, optimism-corrected measures showed similarly good calibration and discrimination (C statistic, 0.720; 95% CI, 0.664-0.765). CONCLUSIONS:Our novel prediction model-based interactive calculator can be used to identify patients at high risk of POAF and could be incorporated into practice prevention guidelines.