Stunting is a chronic malnutrition condition affecting children under five years that impairs cognitive development, physical growth, and future productivity. This study develops a stunting risk prediction model using the Extreme Gradient Boosting (XGBoost) algorithm with hyperparameter tuning and data balancing techniques. The dataset from Kaggle contains 120,998 records with variables including age, gender, height, and nutritional status. The methodology encompasses data preprocessing for outlier handling, categorical encoding, and feature extraction based on height thresholds. Feature selection utilized ANOVA F-test, while Exploratory Data Analysis identified height as the most influential attribute. To address class imbalance, Synthetic Minority Over-sampling Technique (SMOTE) was implemented, followed by Bayesian Optimization for hyperparameter tuning. Model evaluation was conducted using various data splits (80:20, 70:30, 60:40, 50:50) with metrics including accuracy, precision, recall, and F1-score. Results demonstrate that the optimized XGBoost model achieved exceptional performance with 0,982% accuracy, 0,973% precision, 0.979% recall, and 0,976% F1-score, consistently across all data configurations. The combination of XGBoost with Bayesian Optimization and SMOTE proves highly effective in handling imbalanced classification tasks. These findings highlight machine learning's potential in supporting public health initiatives through accurate early identification and targeted intervention for stunting prevention.