Tungsten oxide (WO x ) films were fabricated by (i) reactive thermal evaporation (RTE) at room temperature with oxygen ambient pressure P O 2 as a parameter, and (ii) reactive magnetron sputtering (RMS) with substrate temperature T s as a parameter. The film structure revealed by x-ray photoelectron spectroscopy, x-ray diffraction, density measurements, infrared absorption, and atomic force microscopy was correlated with the nanoindentation hardness H. The RTE WO x films deposited at high P O 2 were amorphous and porous, while H depended appreciably on normalized penetration depth h D (indentation depth/film thickness) due to the closing of the pores at the point of indentation. Decrease in P O 2 from 10 to 2 × 10 −3 mtorr led to smaller porosity, weaker h D dependence of H, and higher average H (measured at h D ≈ 0.2 to 0.3, for example). The RMS WO x film deposited at room temperature was amorphous and denser than all RTE films. The rise in substrate temperature T s first densified the film structure (up to 110°C) and then induced crystallization with larger grain size for T s ജ 300°C. Correspondingly, the h D dependence of H became weaker. In particular, H of the RMS sample deposited at 110°C showed a peak at h D slightly above 1 owing to pileup at the contact point of indentation. For higher T s , pileup occurred at shallower h D and the average H (measured at h D ≈ 0.2 to 0.3, for example) rose, accompanied by the increase of grain size.