The merger of two massive (about 30 solar masses) black holes has been detected in gravitational waves1. This discovery validates recent predictions2,3,4 that massive binary black holes would constitute the first detection. Previous calculations, however, have not sampled the relevant binary-black-hole progenitors—massive, low-metallicity binary stars—with sufficient accuracy nor included sufficiently realistic physics to enable robust predictions to better than several orders of magnitude5,6,7,8,9,10. Here we report high-precision numerical simulations of the formation of binary black holes via the evolution of isolated binary stars, providing a framework within which to interpret the first gravitational-wave source, GW150914, and to predict the properties of subsequent binary-black-hole gravitational-wave events. Our models imply that these events form in an environment in which the metallicity is less than ten per cent of solar metallicity, and involve stars with initial masses of 40–100 solar masses that interact through mass transfer and a common-envelope phase. These progenitor stars probably formed either about 2 billion years or, with a smaller probability, 11 billion years after the Big Bang. Most binary black holes form without supernova explosions, and their spins are nearly unchanged since birth, but do not have to be parallel. The classical field formation of binary black holes we propose, with low natal kicks (the velocity of the black hole at birth) and restricted common-envelope evolution, produces approximately 40 times more binary-black-holes mergers than do dynamical formation channels involving globular clusters11; our predicted detection rate of these mergers is comparable to that from homogeneous evolution channels12,13,14,15. Our calculations predict detections of about 1,000 black-hole mergers per year with total masses of 20–80 solar masses once second-generation ground-based gravitational-wave observatories reach full sensitivity.