In the present work the mechanical properties of ZnO thin films, deposited on Si (100) substrates, were studied using the nanoindentation technique. ZnO thin films were deposited by radiofrequency sputtering from a ZnO target with different H2/Ar gas mixtures. During the deposition the plasma species were in-situ monitored using optical emission spectroscopy (OES). The results showed that the introduction of H2 in the plasma phase had a strong effect on the material’s hardness and elastic modulus. The measured elastic modulus values were then related to the material density to estimate the porosity of the ZnO films. We found an increased film porosity when H2 was added to the sputtering gas, from 6% to 18% in volume. Moreover we found that the porosity was correlated by the emission intensity ratio of atomic Argon on atomic Hydrogen.