Bone health is a field that has become very important in recent years, especially in diseases related to bones, since they are becoming more common among humans. Osteoporosis currently causes an estimated 8.9 million fractures annually. Bone mineral density (BMD) and bone mineral content (BMC) are indicators that can diagnose the problem of bone health. The objective of this study is to classify BMD in children and adolescents using automatic learning techniques. A descriptive cross-sectional study was developed. We studied 660 schoolchildren from two educational centers with an age range of 6 to 18 years from the province of Arequipa (Peru). Anthropometric variables were evaluated. The BMD and CMO were determined. The Body Mass Index (BMI) was calculated, and a comparative study was made of 9 machine learning algorithms related to the subject. These include decision trees, bayesian networks, decision and regression tables. Random Forest's classification algorithm is 94.87%. This algorithm allowed to implement a software. This tool allows to calculate the bone health of schoolchildren between 6 to 18 years. The algorithm obtained can be implemented from a prediction software that allows the classification and prevention of the deterioration of the bone health of children and adolescents.