Based on the density functional theory (DFT), the first-principles methods are used to study and compare the electronic structures and optical properties of Mg-, Sr-doped CaF 2 systems with those of CaF 2 bulk in detail. In contrast to CaF 2 bulk, the band gaps of doped systems become narrower and the new peaks of density states appear. The orbital interactions between Mg, Sr atoms and Ca atom are enhanced near the Fermi level, besides, the doped systems all show single dielectric properties and their absorption coefficients for ultraviolet light are reduced greatly, for Ca 7 SrF 16 system, there is a small absorption peak at 25.44 eV. Compared with CaF 2 bulk, doped systems have much lower extinction coefficients and much higher light transmittance in the ultraviolet region. In addition, their reflection and loss peaks all display red shift and the peak value reduce.