Surface acoustic wave (SAW) devices based on piezoelectric thin-films such as ZnO and AlN are widely used in sensing, microfluidics and lab-on-a-chip applications. However, for many of these applications, the SAW devices will inevitably be used in acid or alkali harsh environments, which may cause their early failures. In this work, we investigated the behavior and degradation mechanisms of thin film based SAW devices in acid and alkali harsh environments. Results show that under the acid and alkali attacks, chemical reaction and corrosion of ZnO devices are very fast (usually within 45 s). During the corrosion, the crystalline orientation of the ZnO film is not changed, but its grain defects are significantly increased and the grain sizes are decreased. The velocity of ZnO-based SAW devices is decreased due to the formation of porous structures induced by the chemical reactions. Whereas an AlN thin-film based SAW device does not perform well in acid-alkali conditions, it might be able to maintain a normal performance without obvious degradation for more than ten hours in acid or alkali solutions. This work could provide guidance for the applications of both ZnO or AlN-based SAW devices in acid/alkali harsh environments.