Stunting, a consequence of persistent malnutri- tion, severely hinders the physical and cognitive development of children under five years of age. In Indonesia, the incidence of stunting was 21.6% in 2022, presenting a significant public health challenge. This research seeks to create efficient machine learning (ML) models for identifying stunting status in chil- dren, utilizing a dataset of 3,000 physical measurements from the Karyajaya Health Center in South Sumatra. The study utilizes two classification algorithms: K-Nearest Neighbors (KNN) and Extreme Gradient Boosting (XGBoost). Data pre- processing encompassed feature selection, outlier elimination via the Interquartile Range (IQR) approach, and rectification of class imbalance through the Synthetic Minority Over- sampling Technique (SMOTE) and parameter optimization. The KNN model was set with five neighbors and distance-based weighting, resulting in an accuracy of 99.43% and an F1-score of 93.89%. The XGBoost model, optimized with a calibrated scale-pos-weight parameter, surpassed KNN by achieving an accuracy of 99.93% and an F1-score of 99.62%. These findings illustrate XGBoost’s exceptional capacity to manage intricate, unbalanced datasets and underscore its promise as a reliable instrument for early stunting identification. The application of XGBoost can assist policymakers and healthcare profes- sionals in delivering prompt interventions, therefore aiding the national objective of decreasing stunting prevalence to 14% by 2024. Subsequent study could improve model accuracy by integrating supplementary genetic and environmental variables across various demographic contexts.