Colorectal cancer significantly impacts global health, with unplanned reoperations post-surgery being key determinants of patient outcomes. Existing predictive models for these reoperations lack precision in integrating complex clinical data. To develop and validate a machine learning model for predicting unplanned reoperation risk in colorectal cancer patients. Data of patients treated for colorectal cancer (n = 2044) at the First Affiliated Hospital of Wenzhou Medical University and Wenzhou Central Hospital from March 2020 to March 2022 were retrospectively collected. Patients were divided into an experimental group (n = 60) and a control group (n = 1984) according to unplanned reoperation occurrence. Patients were also divided into a training group and a validation group (7:3 ratio). We used three different machine learning methods to screen characteristic variables. A nomogram was created based on multifactor logistic regression, and the model performance was assessed using receiver operating characteristic curve, calibration curve, Hosmer-Lemeshow test, and decision curve analysis. The risk scores of the two groups were calculated and compared to validate the model. More patients in the experimental group were ≥ 60 years old, male, and had a history of hypertension, laparotomy, and hypoproteinemia, compared to the control group. Multiple logistic regression analysis confirmed the following as independent risk factors for unplanned reoperation (P < 0.05): Prognostic Nutritional Index value, history of laparotomy, hypertension, or stroke, hypoproteinemia, age, tumor-node-metastasis staging, surgical time, gender, and American Society of Anesthesiologists classification. Receiver operating characteristic curve analysis showed that the model had good discrimination and clinical utility. This study used a machine learning approach to build a model that accurately predicts the risk of postoperative unplanned reoperation in patients with colorectal cancer, which can improve treatment decisions and prognosis.