The influence of sputtering parameters and annealing on the structure and optical properties of TiO2 thin films deposited by RF magnetron sputtering is reported. A pure TiO2 target was used to deposit the films on Si(100) and glass substrates, and Ar/O2 gas mixture was used for sputtering. It was found that both the structure and the optical properties of the films depend on deposition parameters and annealing. In all cases the as-deposited films were oxygen deficient, which could be compensated by post-deposition annealing. Changes in the Ar/O2 mass flow rate affected the films from an amorphous-like structure for samples deposited without oxygen to a structure where nano-crystalline rutile phase is detected in those deposited with O2. Annealing of the samples yielded growth of both, rutile and anatase phases, the ratio depending on the added oxygen content. Increasing mass flow rate of O2 and annealing are responsible for lowering of the energy band gap values and the increase in refractive index of the films. The results can be interesting towards the development of TiO2 thin films with defined structure and properties.