This study aimed to assess the associations of total body fat and fat distribution with bone mineral density (BMD) among children and adolescents in this cross-sectional study. A total of 1032 boys and 897 girls aged 6-17years were enrolled between May 2019 and June 2019 in Guangzhou, China. BMD, total body fat (fat mass index [FMI] and body fat percentage [BF%]), and fat distribution (trunk-to-limb and android-to-gynoid ratios) were measured by dual-energy X-ray absorptiometry. Inverse probability of treatment weighting regression was used to explore the association between fat and BMD. Traditional regression of covariate adjustment was applied as sensitivity analysis. Regression with inverse probability weighting suggested BF% and android-to-gynoid ratio were negatively associated with BMD in boys (β = - 0.12 and - 0.16, respectively; P < 0.05). Android-to-gynoid ratio was also inversely associated with BMD in girls (β = - 0.08, P < 0.05). When stratified by age, the negative associations were retained in boys aged 12-17years (β = - 0.23 and - 0.25, respectively; P < 0.001). But for girls, it showed a positive association of FMI with BMD in the 6-9years group (β = 0.33, P < 0.001) and a negative association between the android-to-gynoid ratio and BMD in the 10-17years group (β = - 0.10, P < 0.05). Traditional regression supported the robustness of the results. Conclusion: Total body fat is positively associated with BMD in younger girls but inversely associated in older boys. As for abdominal adipose, it is associated with lower BMD in both older boys and girls. What is Known: • The lean mass has been consistently positively associated with bone mineral density (BMD) among children and adolescents. However, the impact of fat mass on BMD remained controversial. • Beyond total body fat, site-specific fat mass, especially abdominal adiposity, might impede bone formation. What is New: • The associations of total body fat and fat distribution with BMD in children and adolescents were gender- and age-specific. • More attention should be paid to the abdominal fat accumulation to promote bone health in older children.