Hydrogen doped AZO films (HAZO) were prepared by RF magnetron sputtering. A systematic study of the effect of substrate to target distance (Dst) on the structural, electrical and optical properties of the as-grown HAZO films was carried out. Compared with the Al-doped ZnO films, the hydrogen in the atmosphere influenced the growth of the films by incorporating in the films and bombarding the surface of the film, namely, the Dst, which induced the residual stress and the roughness of the films decreasedwith an increase of the Dst. The films showed a smaller grain size. The surfacework function of the films changed with the composition of the films, reaching a maximum at 7.5cm.