This study examined the association between healthy lifestyle score (HLS), which contained 7 items (smoking, BMI, physical activity, diet, alcohol, sleep and anxiety) and BMD. Results showed HLS was positively associated with BMD at all studied sites, suggesting that healthier lifestyle patterns might be beneficial to bone health. Purpose Previous studies have reported favourable associations of individual healthy lifestyle factors with bone mineral density (BMD), but limited evidence showed the relationship of a combined healthy lifestyle score (HLS) with BMD. This study examined the association between the HLS and BMD. Methods This community-based cross-sectional study included 3051 participants aged 40-75 years. The HLS contained 7 items (smoking, BMI, physical activity, diet quality, alcohol intake, sleep and anxiety). BMD values of whole body (WB), lumbar spine 1-4 (L1-4), total hip (TH) and femur neck (FN) were measured using dual-energy X-ray absorptiometry. Results After adjusting for potential covariates, HLS was positively associated with BMD at all studied sites (P-trend < 0.01). The mean BMDs were 2.69% (WB), 5.62% (L1-4), 6.13% (TH) and 5.71% (FN) higher in participants with HLS of 6-7 points than in those with HLS of 0-2 points. The per 1 of 7 unit increase in the HLS was associated with increases of 7.63 (WB)-13.4 (TH) mg/cm(2)BMD levels at all sites. These favourable associations tended to be more pronounced in men than in women. Among the 7 items, physical activity contributed most to the favourable associations, followed by BMI, non-smoking and diet; the other three items played little roles. Sensitivity analyses showed that the significant associations remained after excluding any one of the 7 components or excluding fracture subjects at all sites. Conclusion Higher HLS was associated with greater BMD in middle-aged and elderly Chinese, suggesting that healthier lifestyle patterns might be beneficial to bone health.