In offshore gas well drilling and production, methane hydrate may block the tubing, resulting in the stoppage of gas production. Conventional methods such as injection of thermal hydrate inhibitors, thermal insulating or heating, gas dehydration and reducing pressure are time-consuming and expensive, and sometimes, they are not realistic in production conditions. New methods are needed to lower the cost of gas hydrate prevention and to overcome these limitations. The thermal effect of cavitation was applied to the prevention of gas hydrate in this study. The thermal impact of cavitation, supposed to heat the fluids and prevent the formation of gas hydrate, was evaluated. Numerical simulation was performed to study the thermal performance of cavitation. Furthermore, experimental studies of the influence of initial temperature, flow rate, fluid volume and fluid viscosity on the thermal effect of cavitation were performed, and the results were analysed.