This study aims to evaluate the role of preoperative vitamin D supplementation before coronary artery bypass grafting (CABG) surgery in preventing postoperative atrial fibrillation (POAF) in vitamin D deficient or insufficient patients. Three randomized controlled trials (RCTs) comprising 448 subjects were selected after a detailed search was conducted on PubMed, Cochrane CENTRAL, Scopus, and Embase in December 2022. Analysis was run using RevMan (version 5.4.1; Copenhagen: The Nordic Cochrane Centre, The Cochrane Collaboration, 2014). The analysis collected risk ratio (RR) and 95% confidence interval (CI) data from the relevant studies, which were then pooled using a random effects model. A significance level of less than 0.05 (p<0.05) was considered significant. Our analysis showed that compared with the standard of care, preoperative vitamin D supplementation in vitamin D deficient and insufficient patients effectively reduced POAF after CABG surgery (RR=0.6, 95% CI=0.4-0.9, P=0.01). There was no significant difference in the duration of hospitalization between the vitamin D supplementation group compared with the control following CABG (mean difference -0.85, 95% CI -2.13 to 0.43, P = 0.19). This meta-analysis shows that preoperative vitamin D supplementation in vitamin D deficient and insufficient patients undergoing CABG can reduce the rate of POAF. As POAF is associated with many complications, providing vitamin D supplementation to individuals with a vitamin D deficiency undergoing CABG can improve long-term cardiovascular outcomes following surgery.