Optical hydrogen sensors have a promising future in a society where hydrogen detection becomes increasingly essential. Sophisticated designs have been reported, which traditionally use Pd as sensing material. Upon hydrogenation, Pd remains metallic and is characterized by a small optical contrast and low sensitivity. Here we report on a new generation hydrogen sensing materials, with a large optical contrast and high sensitivity in a broad hydrogen pressure sensing range. We show that the sensitivity of transparent hydrides is strongly increased by changing the intrinsic mechanism of hydrogenation. Using the robust behavior of the metallic glass Ni–Zr upon hydrogenation, we made amorphous Mg–Ni–Zr where the interplay of transparent Mg2NiH4 and glassy Ni–Zr provides unprecedented advantages. We demonstrate practical usage of the novel hydride Mg–Ni–Zr in gas and liquid environments corresponding to realistic applications.