The possibility that the dark matter comprises primordial black holes (PBHs) is considered, with particular emphasis on the currently allowed mass windows at \(10^{16}\) - \(10^{17}\,\)g, \(10^{20}\) - \(10^{24}\,\)g and \(1\) - \(10^{3}\,M_{\odot}\). The Planck mass relics of smaller evaporating PBHs are also considered. All relevant constraints (lensing, dynamical, large-scale structure and accretion) are reviewed and various effects necessary for a precise calculation of the PBH abundance (non-Gaussianity, non-sphericity, critical collapse and merging) are accounted for. It is difficult to put all the dark matter in PBHs if their mass function is monochromatic but this is still possible if the mass function is extended, as expected in many scenarios. A novel procedure for confronting observational constraints with an extended PBH mass spectrum is therefore introduced. This applies for arbitrary constraints and a wide range of PBH formation models, and allows us to identify which model-independent conclusions can be drawn from constraints over all mass ranges. We focus particularly on PBHs generated by inflation, pointing out which effects in the formation process influence the mapping from the inflationary power spectrum to the PBH mass function. We then apply our scheme to two specific inflationary models in which PBHs provide the dark matter. The possibility that the dark matter is in intermediate-mass PBHs of \(1\) - \(10^{3}\,M_{\odot}\) is of special interest in view of the recent detection of black-hole mergers by LIGO. The possibility of Planck relics is also intriguing but virtually untestable.