A uniform TiO2 nanoparticle coating was prepared both on steel and slide glass using sol–gel method and hydrothermal post-treatments. The particle size in the sol was determined to be ～2nm. The surface morphology and the structure of the coatings were analyzed by scanning electron microscope (SEM) and X-ray diffraction（XRD）, which revealed the surface was compact and well-distributed, and the main phase was anatase. UV-VIS spectrophotometer indicated that a absorption peak existed at 340nm. The anticorrosion performances of the coatings in dark and under ultraviolet illumination have been evaluated by electrochemical techniques.