The variation in local atomic structure and chemical bonding of ZrHx (x = 0.15, 0.30, and 1.16) magnetron sputtered thin films are investigated by Zr K-edge (1s) X-ray absorption near-edge structure and extended X-ray absorption fine structure spectroscopies. A chemical shift of the Zr K-edge toward higher energy with increasing hydrogen content is observed due to charge-transfer and an ionic or polar covalent bonding component between the Zr 4d and the H 1s states with increasing valency for Zr. We find an increase in the Zr-Zr bond distance with increasing hydrogen content from 3.160 angstrom in the hexagonal closest-packed metal (alpha-phase) to 3.395 angstrom in the understoichiometric delta-ZrHx film (CaF2-type structure) with x = 1.16 that largely resembles that of bulk delta-ZrH2. For even lower hydrogen contents, the structures are mixed alpha- and delta-phases, while sufficient hydrogen loading (x > 1) yields a pure delta-phase that is understoichiometric, but thermodynamically stable. The change in the hydrogen content and strain is discussed in relation to the corresponding change of bond lengths, hybridizations, and trends in electrical resistivity.