We aimed to assess whether circulating sex steroids would influence bone density and bone loss, whether part of this influence could be explained by genetic variation measured as polymorphisms in candidate genes affecting circulating hormone levels, or whether gene polymorphisms would have direct effects on bone in 229 postmenopausal Japanese women aged 46 years and over who had been followed for eight years (Yokohama Cohort). Bone mineral density (BMD) in the lumbar spine (L), femoral neck (FN), total hip (T) and distal radius (R) was measured every year, and endogenous sex steroid levels were determined at the start of the study. We investigated the polymorphisms of estrogen-metabolizing enzyme gene, CYP17; estrogen biosynthesis (high activity, A2/A2), CYP1A1; hydroxylation (high inducibility, vt/vt) and COMT; inactivation (low activity, L/L) with PCR-based restriction fragment length polymorphism assays. Dehydroepiandrosterone (DHEA) and androstenedione (AND) levels significantly correlated with bone density in both the axial (L) and the appendicular skeleton (FN, T and R) ( r = 0.194–0.229; P < 0.05) whereas estradiol (E2) and AND showed significant correlations with bone change only at the axial skeleton ( r = 0.205 and r = − 0.139, respectively; P < 0.05) on the total cohort. These correlations remained significant in thin/normal-weight women [body mass index (BMI) < 25 kg/m 2)] even after adjustment for years since menopause (YSM) and BMI or age and BMI, suggesting an interaction of BMI and sex steroid/BMD association. On the total cohort, a difference in endogenous DHEA levels between CYP17 homozygote A2 and non-homozygote A2; an increasing trend in AND levels from COMT L/L, L/H, to H/H; and a difference in TS level between COMT homozygote L and non-homozygote L were separately observed. All observations were significant for unadjusted and adjusted analysis, except for COMT and TS. In thin/normal-weight women (BMI < 25 kg/m 2), the same effects of CYP17 genotypes on DHEA were observed as on the total cohort. CYP17 and COMT genes showed some direct influence on bone density. Mean percent change in T-BMD was negative for CYP17 non-homozygote A2 in contrast to a positive value for homozygote A2. Mean percent change in R-BMD showed the difference between COMT homozygote L and non-homozygote L with a larger decrease for the homozygote L. Together, CYP17 and COMT genotypes might have some effect on bone both directly and indirectly through their effects on endogenous sex steroids in postmenopausal Japanese women.