Co doped TiO2 nanoparticles and thin films were prepared from Ti(OC4H9)4 by sol-gel method. The influence of Co-doping and its content on the crystallite structure and phase composition of TiO2 was systematically investigated by SEM and XRD, the precursor was analysed by TGA. The photocatalytic activity of nanocomposites was investigated in the photocatalytic degradation of methyl orange. The results indicated that the inhibitory effect of Co-doping on the phase transformation of TiO2 from anatase to rutile receded obviously when the calcination temperature was changed to 650°C from 550°C. Under the ultraviolet light radiation, the favourite Co-doping concentration was 1% and the obtained Co doped TiO2 thin films exhibited higher photocatalytic activity than nanoparticles and pure TiO2 in the photodegradation of methyl orange.