The influence of Ag doping on the SnO2 sensor operating at room temperature is reported in this work. The SnO2 and Ag-doped SnO2 films are deposited by the nebulizer spray pyrolysis method with different Ag (1, 2, 3, and 4 wt%) concentrations. The characterization of doped thin films was done using multiple advanced techniques to understand their crystallization, morphology, optical and electrical properties to find the optimized Ag concentration on the SnO2 surface. It was found that the doping of different concentrations into the SnO2 lattice increases the preferential orientation of the peak along (211) plane up to 3wt% Ag and starts decreasing at 4 wt%. The estimated crystallite size of the 3wt% Ag-doped SnO2 thin films shows larger value of 98 nm with improved thickness and decreased strain. The morphologies of all the prepared thin films exhibits small leafy flakes structure with change in the particle size and improved agglomeration with increased Ag concentration. The optical studies showed better transparency in the visible and near-IR regions with decreased transmittance and increase in bandgap with increasing Ag concentration in SnO2. The PL results suggest that the 3wt% Ag-doped SnO2 has high-intensity emission peaks over the visible regions indicating the presence of more oxygen vacancies which acts as recombination centers to trap large amount of target gas. Finally, the gas sensing properties of the samples at different concentration of ammonia gas (i.e., 50, 100, 150, 200, and 250 ppm) are studied, which revealed that the 3wt% Ag-doped SnO2 showed better sensitivity/response of 120% with maximum response and recovery times of 32 and 17 s at 250 ppm of ammonia gas. Thus, the undoped SnO2 has been optimized with different doping amounts of Ag ions to obtain the best ammonia sensor. [ABSTRACT FROM AUTHOR]