The influence of the GaAs surface condition on the properties and thermal stability of WNx Schottky diodes on GaAs has been studied by performing in situ H2 and N2 plasma treatments just before the WNx sputter deposition. The WNx/GaAs contacts have been investigated by x-ray photoelectron spectroscopy, Rutherford backscattering, nuclear reaction analysis, secondary ion-mass spectroscopy, x-ray diffraction, and transmission electron microscope and correlated to electrical current-voltage and capacitance-voltage measurements. A strong correlation was found between the diode properties and the surface conditions, both for the as-deposited samples and for samples annealed in the range 700-850 °C. Poor rectifying properties were obtained for the plasma-cleaned diodes due to the cumulative effects of plasma cleaning and sputter deposition. After annealing, improved characteristics were generally found. The highest Schottky barrier height values φI-V=0.76 V, which were found for the H2 plasma treated diodes annealed at 800 °C, were almost independent of the WNx composition and sputtering conditions. The H2 treated samples also showed the smoothest WNx/GaAs interface. HCl cleaned and N2 treated surface also showed high-barrier height and small interfacial reactions after high-temperature annealing.