We demonstrate the electrochromic properties of TiO2 nanotubes prepared by an anodization process and investigate the effects of heat treatment and viologen incorporation on them. The morphology and crystal structure of anodized TiO2 nanotubes are investigated by scanning electron microscopy and X-ray diffraction. As-formed TiO2 nanotubes have straight tubular layers with an amorphous structure. As the annealing temperature increases, the anodized TiO2 nanotubes are converted to the anatase and rutile phases with some cracks on the tube surface and irregular morphology. Electrochemical results reveal that amorphous TiO2 nanotubes annealed at 150°C have the largest oxidation/ reduction current, which leads to the best electrochromic performance during the coloring/bleaching process. Viologenanchored TiO2 nanotubes show superior electrochromic properties compared to pristine TiO2 nanotubes, which indicates that the incorporation of a viologen can be an effective way to enhance the electrochromic properties of TiO2 nanotubes.