Ag nanoparticles dispersed SiO2 composite films were successfully prepared by a sol–gel method. The structural transition, formation, and optical property along with relevant band gap of Ag/SiO2 thin films during the annealing process were studied by Fourier transform infrared spectroscopy, thermogravimetry–differential thermal analysis, x-ray diffraction, and ultraviolet–visible spectroscopy, while the microstructure of thin films was revealed by transmission electron microscopy. The results indicate that the Ag spherical particles with the diameter of 10–20 nm were formed by breaking Si–O–Ag bonds above 200 °C and dispersed in the SiO2 matrix. The optical absorption property of Ag/SiO2 nanofilm in the visible range is enhanced, and the band gap (Eg) is widened with raising annealing temperatures, which is promising for the potential applications in nonlinear optical and related fields.