Osteoporosis is a common disorder, affecting hundreds of millions of people worldwide, and characterized by decreased bone mineral density and increased fracture risk. Known nonheritable risk factors for primary osteoporosis include advanced age, sex-steroid deficiency and increased oxidative stress. Age is a nonmodifiable risk factor, but the influence of a person's lifestyle (diet and physical activity) on their bone structure and density is modifiable to some extent. Heritable factors influencing bone fragility can be monogenic or polygenic. Osteogenesis imperfecta, juvenile osteoporosis and syndromes of decreased bone density are discussed as examples of monogenic disorders associated with bone fragility. So far, the factors associated with polygenic osteoporosis have been investigated mainly in genome-wide association studies. However, epigenetic mechanisms also contribute to the heritability of polygenic osteoporosis. Identification of these heritable and nonheritable risk factors has already led to the discovery of therapeutic targets for osteoporosis, which emphasizes the importance of research into the pathogenetic mechanisms of osteoporosis. Accordingly, this article discusses the many heritable and nonheritable factors that contribute to the pathogenesis of primary osteoporosis. Although osteoporosis can also develop secondary to many other diseases or their treatment, a discussion of the factors that contribute only to secondary osteoporosis is beyond the scope of this Review.