The electronic structures and absorption spectra of LiTaO<sub>3</sub> (LT) crystal and Fe:Mg:LiTaO<sub>3</sub> crystal with different Mg concentrations are investigated by first-principles through using the density functional theory. The supercell crystal structures are established with 60 atoms with four models: the near-stoichiometric pure LiTaO<sub>3</sub> crystal (LT); the iron doped LiTaO<sub>3</sub> crystal (Fe:LT), with the charge compensation model expressed as Fe<sub>Li</sub><sup>2+</sup>-2V<sub>Li</sub><sup>–</sup>; the iron and magnesium co-doped LiTaO<sub>3</sub> crystal (Fe:Mg:LT), with the charge compensation model taken as Fe<sub>Li</sub><sup>2+</sup>-Mg<sub>Li</sub><sup>+</sup>-3V<sub>Li</sub><sup>–</sup>; the other iron and magnesium co-doped LiTaO<sub>3</sub> crystal (Fe:Mg(E):LT), with Mg ion concentration near threshold value (slightly less than 6 mol%) and taking the charge compensation model as 2Mg<sub>Li</sub><sup>+</sup>-Fe<sub>Ta</sub><sup>2–</sup>. The geometry optimization results show that the total energy values of all models can achieve certain stable values, which means that the models used in this paper are very close to the actual crystal structures. In the electronic structures, the extrinsic defect energy levels in the forbidden band of Fe:LT crystal are mainly contributed from the Fe 3d orbital, and the band gap of Fe:LT about 3.05 eV is narrower than that of LT, the band gap of Fe:Mg:LT and Fe:Mg(E):LT sample are 2.72 eV and 2.45 eV respectively. The results show that the orbit of Fe 3d, Ta 5d and O 2p are superposed with each other, forming covalent bonds, which results in conduction band and valence band shifting toward low energy in iron doped LiTaO<sub>3</sub> crystal. The Fe 3d orbit is split into E<sub>g</sub> orbit and T<sub>2g</sub> orbit under the influence of the crystal field. There are two absorption peaks at 417 nm (2.97 eV) and 745 nm (1.66 eV) in the Fe:LiTaO<sub>3</sub> crystal. The first one is attributed to the transfer of the T<sub>2g</sub> orbital electron to conduction band. The last one can be taken as the result of E<sub>g</sub> electron transfer of Fe<sup>2+</sup> in crystal. The intensities and positions of these peaks vary with the concentration of Mg ion. Specially, with the concentration of Mg ion attaining the threshold value, the peak at 745 nm disappears, and the other peak moves slightly to 457 nm (2.71 eV). With the Mg ion concentration at the threshold value, the Fe ions can occupy Ta positions. This occupying condition makes the E<sub>g</sub> orbital energy change greatly compared with the scenario in the Fe<sub>Li</sub> condition, and it affects hardly the T<sub>2g</sub> orbital energy. So, if the absorption nearby 745 nm waveband can be taken as the useful process in holographic storage application, it is better to take smaller concentration of Mg ions (less than threshold value). On the other hand, nearby 457 nm waveband, concentration of Mg ions can be chosen as a large value.