In this work, we focused on the investigation of the lattice structure and optical energy of La0.8Sr0.2Fe1-xMgxO3 nanoparticles. The single phase La0.8Sr0.2Fe1-xMgxO3 (x = 0.1, 0.2, and 0.3) nanoparticles have been successfully synthesized by sol-gel method. The substantial effect on the lattice structure and optical energy analysis have been observed. The analysis of X-ray diffraction (XRD) pattern revealed the single phase cubic structure with Pm3m space group following by the increasing of lattice parameter and crystallite size with increasing of Mg-content. The element ration against the set value of Mg-substitution was also confirmed by Energy Dispersive X-ray (EDX) data. The Mg-substitution dependent structural changes were also verified by Fourier transform infrared (FTIR) spectrum in regards to downward shift of stretching mode (Fe/Mg-O) and Fe/Mg-O-Fe/Mg bending mode of vibrations. The optical band gap energy, obtained by using Uv-vis spectroscopy, have been found in the range of 1.05-1.35 eV and decreased with increasing of Mg-content.