Abstract Background The relationship between bone mineral density (BMD) and body composition in hemodialysis (HD) patients with end-stage kidney disease (ESKD) is still inconclusive. Methods A number of 124 ESKD patients who received regular HD were included. Body mass index (BMI) was calculated. Body fat mass (BFM), soft lean mass (SLM), fat-free mass (FFM), skeletal muscle mass (SMM), percent body fat (PBF), and skeletal muscle mass index (SMI) were measured using bioelectrical impedance analysis. BMD of the proximal radius of the selected subjects was measured by dual-energy X-ray absorptiometry. Results Among 124 ESKD patients, 32 (25.8%) had diabetes. BMD, BMI, BFM, SMI, and PBF were significantly higher in HD patients with diabetes than in those without diabetes (P < 0.05). In patients with diabetes, BMD, SLM, FFM, and SMM were significantly higher in male patients than in female patients (P < 0.05), while BFM and PBF were lower in female patients (P < 0.05). Spearman correlation analysis showed that SLM, FFM, and SMM were positively associated with BMD in HD patients (P < 0.05). Multiple linear regression analysis showed that SMI was positively correlated with BMD in non-diabetes HD patients. Logistic regression analysis showed that diabetes was independently associated with a lower risk of developing osteoporosis than non-diabetes (odds ratio [OR] = 0.169, 95% confidence intervals [CI] = 0.043–0.661, P = 0.011). Conclusion BMI, SMI, and BMD were higher in HD patients with diabetes than in non-diabetes. Diabetes may be associated with a lower risk of developing osteoporosis in HD patients.