Yttrium oxyhydride (YHO) undergoes a reversible photochromic transition when exposed to ultraviolet light. However, the mechanism for this transformation is not fully understood, and the structure and precise chemical composition of YHO remain under debate. Here, we use first-principles density functional theory calculations with a hybrid functional to study the structure, chemical stability, and point defect properties of YHO. As experiments have shown, we find that YHO prefers a cubic structure, with H and O anions present in equal concentrations and located on tetrahedral sites. Stoichiometric and ordered YHO is chemically stable, but it has a wide band gap of 5.01 eV, considerably larger than that measured in experiments (2.4−3.8 eV). On the other hand, Y 4 H 10 O has a smaller band gap of 2.97 eV and also has a region of chemical stability; thus, the actual material may include some fraction of this H-rich structure. The defect chemistry of YHO is dominated by anionic antisite species (H O and O H ), with hydrogen interstitials (H i ) and vacancies (V H ) also present in reasonably high concentrations. We show that antisite disorder lowers the band gap relative to the perfectly ordered structure, bringing the magnitude of the gap into closer agreement with experiment. Based on our calculations of defect migration and the positions of defect states relative to the band edges, we link the onset of photochromic behavior to the reaction H O − → V O 0 + H i − , which follows photoexcitation of a H O + defect. H i − can subsequently migrate away and be trapped by additional H O + defects, contributing to the persistence of the reaction, while the resultant oxygen vacancy, V O 0 , introduces an occupied defect state that leads to optical absorption at visible wavelengths. Our results can explain reported discrepancies between experimental and computational results for YHO, and they allow us to propose specific atomic-scale processes that can lead to photochromism. Understanding these mechanisms is key for unlocking YHO's application in devices ranging from smart windows and optoelectronics to electrochemical synapses for neural networks.