In today’s educational institutions, student performance can vary widely due to differences in cognition, motivation, and environmental factors. These variations create challenges in achieving optimal learning outcomes. To address these challenges, Optimal Group Formation (OGF) has emerged as a promising research area. Optimal Group Formation (OGF) aims to form student groups that maximize learning efficiency based on past academic performance. Group formation problems are inherently complex and time-consuming, but their applications are extensive, spanning from manufacturing systems to educational contexts. This paper introduces a machine learning-based model designed to create optimal student groups using academic records as the primary input. The goal is to enhance overall group performance and reduce error rates by organizing students into cohesive, efficient teams. What sets this research apart is its focus on educational group formation, leveraging machine learning to improve collaborative learning outcomes. The paper also reviews prior research, emphasizing the importance of Optimal Group Formation (OGF) in various fields and its relevance in education. The model’s effectiveness is demonstrated through comparative analysis, showcasing its potential to improve group dynamics in both theoretical and lab-based courses. Ultimately, the aim is to improve educational outcomes by ensuring that student groups are optimally balanced and structured.