The structure and composition of hafnium diboride films grown by rf magnetron sputtering have been studied by X-ray diffraction and secondary ion mass spectrometry. The results demonstrate that the key parameters of the process are the bias-dependent energy of incident particles and the substrate temperature. The substrate microstructure may also have a significant effect on the film growth process, when the first two factors are negligible. We have examined the microstructure effect on the elemental composition of the films. The secondary ion emission coefficient for boron in highly textured films is shown to be 20–25% above that in the powder target. At the same time, clustered amorphous films have a reduced boron content: B/Hf < 2.