Abstract. Niobium hydride is suspected to be a major contributor to degradation of the quality factor of niobium superconducting radio-frequency (SRF) cavities. In this study, we connect the fundamental properties of hydrogen in niobium to SRF cavity performance and processing. We modeled several of the niobium hydride phases relevant to SRF cavities and present their thermodynamic, electronic, and geometric properties determined from calculations based on density-functional theory. We find that the absorption of hydrogen from the gas phase into niobium is exothermic and hydrogen becomes somewhat anionic. The absorption of hydrogen by niobium lattice vacancies is strongly preferred over absorption into interstitial sites. A single vacancy can accommodate six hydrogen atoms in the symmetrically equivalent lowest-energy sites and additional hydrogen in the nearby interstitial sites affected by the strain field: this indicates that a vacancy can serve as a nucleation center for hydride phase formation. Small hydride precipitates may then occur near lattice vacancies upon cooling. Vacancy clusters and extended defects should also be enriched in hydrogen, potentially resulting in extended hydride phase regions upon cooling. We also assess the phase changes in the niobium-hydrogen system based on charge transfer between niobium and hydrogen, the strain field associated with interstitial hydrogen, and the geometry of the hydride phases. The results of this study stress the importance of not only the hydrogen content in niobium, but also the recovery state of niobium for the performance of SRF cavities.