In the present work, we have concentrated on the structural, electronic, and optical properties of single-layer phase MgCl2. When bulk MgCl2 reduces to monolayer form, then it exhibited indirect to direct bandgap transformation. The result indicates that the monolayer MgCl2 exhibits insulating characteristics with a direct bandgap of 7.377 eV whereas its bulk form has an indirect bandgap of 7.02 eV. It means that when reducing the dimensionally of the MgCl2 materials than its bandgap significantly increased. The optical properties of the monolayer MgCl2 have been investigated using DFT within the random phase approximation. The calculated refractive index values are very near to water, which means that monolayer MgCl2 material will be a transparent material. Also, the optical absorption coefficient is found to be very high in the ultraviolet (UV) region. From optical properties, the out-of-plane (E⊥Z) direction of polarizations is shifted towards the higher photon energy as compared to the in-plane (E||X) direction. From the optical properties profile, the polarizations along in-plane and out-of-plane are different therefore it shows anisotropic behavior. These investigated results show the monolayer MgCl2 could be a promising material for optoelectronic nanodevices such as deep UV emitters and detectors, electrical insulators, atomically thin coating materials.