The effect of temperature and UV irradiation on the corrosion behavior of 304 stainless steel exposed to a simulated marine atmosphere was studied. The corroded samples were analyzed in detail through potentiodynamic polarization, in situ electrochemical impedance spectroscopy, Mott-Schottky measurements, scanning electron microscopy, and X-ray photoelectron spectroscopy. The results showed that the corrosion rate of 304 SS was significantly inhibited by UV irradiation, and the inhibition effect increased at a higher temperature. The UV irradiation not only changed the corrosion products morphologies formed on the 304 SS surface but also the relative content of the corrosion products was changed. In particular, UV irradiation can promote the formation of Cr 2 O 3 in corrosion products, especially at a higher temperature, thus improving the corrosion resistance of 304 SS.