TiO2 thin films were prepared by r.f. magnetron sputtering and spray pyrolysis. Films were grown on Si (100) and interdigitated gold on alumina substrates. The film morphology and roughness were determined using atomic force microscopy. The films obtained by r.f. sputtering were smoother with rms surface roughness of about 0.8 nm (over a 5µm × 5 µm scan area) whereas the rms roughness of the films prepared by spray pyrolysis was around 3.9 nm (over 5 µm × 5 µm scan area). The crystal structure was determined using glancing incidence x-ray diffraction and it was observed that the r.f. sputtered films consisted of rutile phase while the films obtained by spray pyrolysis were anatase phase. The optical parameters namely, refractive index (n) and extinction coefficient (k) were estimated using a variable angle spectroscopic ellipsometry. Gas sensing studies with ammonia revealed that rutile phase is sensitive while the anatase phase showed no response. A correlation is given between optical, sensing properties and microstructure.