With the help of the ab initio full-potential linearized augmented plane wave (FPLAPW) method, calculations of the electronic structure and linear optical properties are carried out for red HgI 2 and yellow HgI 2 . It is found that the red HgI 2 has a direct gap of 1.22834 eV and the yellow HgI 2 has an indirect gap of 2.11222 eV. For the red HgI 2 , the calculated optical spectra are qualitatively in agreement with the experimental data. Furthermore, the origins of the different peaks of ε 2 (ω) are discussed. Our calculated anisotropic dielectric function of the red HgI 2 is a nice match with the experimental results. Our calculated results are able to reproduce the overall trend of the experimental reflectivity spectra. Although no comparable experimental and theoretical results are available, clearly, the above proves the reliability of our calculations, suggesting that our calculations should be convincing for the yellow HgI 2 . Finally, the different optical properties are discussed.