This study investigates the structural and optical properties of MgO:SnO2 nanoparticles using the Chemical precipitation method, The thin films were deposited by the spin coating technique on glass substrates. X-ray diffraction analysis proved the crystalline structure of prepared thin films, with the peaks corresponding to the (110), (101), (200), (211), and (220) planes, with the tetragonal SnO2 crystal structure, Fourier transforms infrared (FTIR), and scanning electron microscope (SEM) used to characterize the functional groups, shape, and dimensions of synthesized metal oxide nanoparticles. The optical properties of the films were studied by UV-Vis spectroscopy, and the bandgap energy was estimated to be in the range of (3.9 - 3.4 eV). The refractive index and extinction coefficient of the films were also determined, and the results indicated that the films had good transparency in the visible region, The study concludes that MgO:SnO2 thin films obtained by spin coating technique have potential applications in optoelectronics and gas sensors.