The purpose of this research is to obtain the cavitation cooling characteristics and flow law in mechanical seals with Rayleigh step pattern. A new cooling approach has been proposed, which is of great significance to preventing liquid film vaporization and limiting thermal deformation of sealing face. Based on the previous literatures focused only on cavitation or viscous heat, the thermohydrodynamic lubrication (THD) and hydrodynamic lubrication (HD) numerical models with cavitation in mechanical seals are developed to obtain the cavitation cooling characteristics and flow mechanism by FLUENT software. The results show that the liquid film cavitation occurs severely in the reverse Rayleigh step and generates a remarkable local cooling effect to the fluid film and sealing faces, which leads to a temperature rise reduction of up to 39.2% and a leakage rate reduction of up to 72.7%. Meanwhile, the high-temperature zone at downstream side migrates upstream, especially, forming temperature valley and peak zones at liquid film rupture and reformation boundaries. The cooling level is controlled by the intensity and area of cavitation. Moreover, the vapor phase block of cavitation, the pressure flow and the shear flow collectively generate a vortex flow behind the cavitation zone in the reverse Rayleigh step. The center and intensity of vortices are closely related to the cavitation area, viscous heat, shear flow and pressure flow. Under THD conditions, the vortex is enhanced due to the viscosity loss and the small cavitation area. The cavitation, viscous heat and vortex flow have important effects on the sealing performance.