Mixing Mg with Ti leads to a hydride Mgx Ti(1−x)H2 with markedly improved (de)hydrogenation properties for x 0.8, as compared to MgH2. Optically thin films of Mgx Ti(1−x)H2 have a black appearance, which is remarkable for a hydride material. In this paper we study the structure and stability of Mgx Ti(1−x)H2, x = 0–1 by first-principles calculations at the level of density functional theory. We give evidence for a fluorite to rutile phase transition at a critical composition xc = 0.8–0.9, which correlates with the experimentally observed sharp decrease in (de)hydrogenation rates at this composition. The densities of states of Mgx Ti(1−x)H2 have a peak at the Fermi level, composed of Ti d states. Disorder in the positions of the Ti atoms eas...