We aimed to examine the effects of a 5:2 diet (2 days per week of energy restriction by formula diet) or an exercise (2 days per week of high-intensity interval training and resistance training) intervention compared with routine lifestyle education (control) on glycemic control and cardiometabolic health among adults with overweight/obesity and type 2 diabetes. This two-center, open-label, three-arm, parallel-group, randomized controlled trial recruited 326 participants with overweight/obesity and type 2 diabetes and randomized them into 12 weeks of diet intervention (n = 109), exercise intervention (n = 108), or lifestyle education (control) (n = 109). The primary outcome was the change of glycemic control measured as glycated hemoglobin (HbA1c) between the diet or exercise intervention groups and the control group after the 12-week intervention. The diet intervention significantly reduced HbA1c level (%) after the 12-week intervention (-0.72, 95% CI -0.95 to -0.48) compared with the control group (-0.37, 95% CI -0.60 to -0.15) (diet vs. control -0.34, 95% CI -0.58 to -0.11, P = 0.007). The reduction in HbA1c level in the exercise intervention group (-0.46, 95% CI -0.70 to -0.23) did not significantly differ from the control group (exercise vs. control -0.09, 95% CI -0.32 to 0.15, P = 0.47). The exercise intervention group was superior in maintaining lean body mass. Both diet and exercise interventions induced improvements in adiposity and hepatic steatosis. These findings suggest that the medically supervised 5:2 energy-restricted diet could provide an alternative strategy for improving glycemic control and that the exercise regimen could improve body composition, although it inadequately improved glycemic control.