Nano-sized TiO2/WO3 bilayer coatings were prepared on type 304 stainless steel substrate by sol–gel method. The performance of photo-electrochemical and photogenerated cathode protection of the coating was investigated by the electrochemical method. The results show that the bilayer coating with four TiO2 layers and three WO3 layers exhibits the highest photo-electrochemical efficiency and the best corrosion resistance property. Type 304 stainless steel with the coating can maintain cathode protection for 6 h in the dark after irradiation by UV illumination for 1 h. In addition, the mechanism of the photogenerated cathode protection for the bilayer coating was also explored.