Hydrogen intercalation changes both the structure and the optical properties of Mg 2 Ni thin films. The structure of evaporated thin films was investigated in the as-deposited, hydrogenated and dehydrogenated states with extended X-ray absorption fine structure (EXAFS) and X-ray diffraction (XRD). The partially crystalline virgin film becomes completely amorphous upon hydrogenation. After removal of the intercalated hydrogen the film remains amorphous. Hydrogen was detected in different concentrations in the virgin, hydrogenated and dehydrogenated films. Hydrogen loading was confirmed both by a shift of the nickel absorption edge and an increase of the hydrogen content. The intercalated hydrogen in the completely loaded film is located around the nickel atom with a coordination close to four.