TiO2 porous thin films were prepared using polystyrene (PS) latex particles as template in conjunction with spin coating technique. In this study, the resulting films were produced by the infiltration of the TiO2 sol particles into the voids between the templates. X-ray diffraction spectra indicated that the porous TiO2/PS thin films have anatase structure. High quality of porous structures was observed by atomic force microscopy. The transmittance spectra have shown that elaborated TiO2/PS thin films have a high transparency in the visible range. To investigate the effect of the templating technique on the photocatalytic activity of porous TiO2/PS thin films, photodegradation of methylene blue (MB) in the presence of TiO2 was performed. It was found that porous TiO2/PS thin films exhibited strong photocatalytic activity. Also, the photocurrent density produced by TiO2/PS thin film electrode reached 0.1 mA/cm2, about four times higher than that measured for pure TiO2 thin film. These results indicate that the templating technique has a better photo-electrochemical performance than that of pure TiO2 thin films under illumination. As a result, the porous TiO2/PS thin film would have great potential in photocatalytic and photoelectrochemical devices.