In the present work, nanostructured TiO2 films were prepared by electrochemical anodization process of titanium in fluoride-containing electrolytes using an innovative approach. After anodization, the TiO2 films were annealed at 480 degrees C for 2 h in air in order to acquire anatase phase transformation and increase its crystallinity. The effects of anodization voltage, electrolyte concentration and anodization time on the formation of TiO2 films and the photocatalytic degradation of methylene blue (MB) were discussed in details. The phase structure and surface morphology of the samples characterized by means of X-ray diffraction and scanning electron microscope. The as-prepared nanostructured TiO2 film anodized in 0.5% HF electrolyte at 15 V for 240 min showed excellent photocatalytic degradation of MB and is promising for environmental purification.