Oxygen‐containing yttrium hydride, YHx:Oy, is an inorganic phothochromic material which exhibits promising features for its application in smart windows, ophthalmic lenses, and many more. In the present work the optical properties of photochromic and non‐photochromic YHx:Oy thin films prepared by magnetron sputtering are studied by variable angle ellipsometry and spectrophotometry. These include the study of the complex refractive index, the transmittance, and luminous transmittance, as well as the reflectance of a selection of samples of diverse structural properties obtained under different deposition conditions. In the case of the photochromic YHx:Oy thin films, the refractive index in the near infrared and visible regions is found similar to the one corresponding to yttrium oxide, Y2O3. However, the YHx:Oy films exhibit a smaller band gap and hence higher absorption in the near ultraviolet than Y2O3. The photodarkening potential of the films are also quantified and characterized by the study and modeling of their optical properties before and after illumination. Our results show that photochromic YHx:Oy films, with a luminous transmittance above 80 % in the clear state, can reduce its transparency up to a 30% after 1 h illumination at 1 Sun.