On glass substrates, silver (Ag) doped Titanium dioxide (TiO2) films at varied levels of concentrations (0, 2, and 4) % wt were synthesized by chemical spray pyrolysis (CSP). As per the X-ray diffraction pattern, the only phases present in the sample were anatase and rutile TiO2. Using AFM, it was discovered that the TiO2 thin films were smooth and compact; however, the surface roughness increases as the dopant amount decreases. SEM images display TiO2 films. Surface transformation is evident with uniform spherical nanograins after Ag doping. The optical characteristics of wavelength range (300-900) nm have been investigated using absorbance and transmittance spectra. The results revealed that the films have a 65-75 % transmittance in VIS-NIR spectra for all films. The allowable direct electronic transitions have (3.15-3.25) eV energy gaps. At 250 ppm, the NH3 gas sensor exhibited increased resistance, indicating heightened sensitivity. Sensitivity decreases with concentration increases to 0 %, 2 %, and 4 % of Ag for NH3 gas. Reduction observed: 18.4% to 4.6% (50 ppm), 20.7% to 6.8% (150 ppm), and 25.9% to 8.2% (250 ppm).