Stunting is a major health priority for children in Indonesia, with a prevalence of 21.6% in 2022, prompting the government to aim for a reduction to 14% by 2024 in accordance with WHO standards. Stunting, caused by prolonged malnutrition, affects children’s physical and cognitive development. Machine learning is needed to develop predictive models that can identify stunting early, enabling timely interventions. This study aims to develop a machine learning-based predictive model for early intervention in stunting. It evaluates the performance of Random Forest (RF), K-Nearest Neighbors (KNN), and a proposed ensemble learning algorithm called Stacked RFKNN. Using a dataset from Bandarharjo Health Center that includes toddler measurements and growth indicators for training and testing, RF excels at handling large feature sets and identifying important predictors, KNN effectively recognizes local patterns, and Stacked RFKNN combines the strengths of both. Given the dataset’s imbalance, with only 4.1% of data related to stunting, oversampling was applied to the minority class. Results show the proposed Stacked RFKNN algorithm outperformed both RF and KNN, achieving a classification accuracy of 99.21% and an F1-score of 95.42%. In comparison, RF achieved an accuracy of 99.12% and an F1-score of 95.05%, while KNN attained an accuracy of 97.19% and an F1-score of 86.14%. This approach offers an accurate predictive system for early stunting intervention, aiding the reduction of stunting rates in Indonesia.