Predicting operative time is essential for scheduling surgery and managing the operating room. This study aimed to develop machine learning (ML) models to predict the operative time for metabolic and bariatric surgery (MBS) and to compare each model. The authors used the Metabolic and Bariatric Surgery Accreditation and Quality Improvement Program database between 2016 and 2020 to develop ML models, including linear regression, random forest, support vector machine, gradient-boosted tree, and XGBoost model. Patient characteristics and surgical features were included as variables in the model. The authors used the mean absolute error, root mean square error, and R 2 score to evaluate model performance. The authors identified the 10 most important variables in the best-performing model using the Shapley Additive exPlanations algorithm. In total, 668723 patients were included in the study. The XGBoost model outperformed the other ML models, with the lowest root mean square error and highest R 2 score. Random forest performed better than linear regression. The relative performance of the ML algorithms remained consistent across the models, regardless of the surgery type. The surgery type and surgical approach were the most important features to predict the operative time; specifically, sleeve gastrectomy (vs. Roux-en-Y gastric bypass) and the laparoscopic approach (vs. robotic-assisted approach) were associated with a shorter operative time. The XGBoost model best predicted the operative time for MBS among the ML models examined. Our findings can be useful in managing the operating room scheduling and in developing software tools to predict the operative times of MBS in clinical settings.