Structural, electronic and optical properties of Mg x Cd 1−x Se (0 x 1) are calculated for the first time using density functional theory. Our results show that these properties are strongly dependent on molar fraction of particular componentsx. The bond between Cd and Se is partially covalent and the covalent nature of the bond decreases as the concentration of Mg increases from 0 % to 100 %. It is found that Mg x Cd 1−x Se has a direct band gap in the entire range of x and the band gap of the alloy increases from 0.43 to 2.46 eV with the increase in Mg concentration. Frequency dependent dielectric constants ε 1 (ω), ε 2 (ω) refractive index n(ω) are also calculated and discussed in detail. The peak value of refractive indices shifts to higher energy regions with the increase in Mg. The larger value of the extraordinary refractive index confirms that the material is a positive birefringence crystal. The present comprehensive theoretical study of the optoelectronic properties of the material predicts that it can be effectively used in optoelectronic applications in the wide range of spectra: IR, visible and UV. In addition, we have also predicted the heat capacities (C V ), the entropy (S), the internal energy (U) and the Helmholtz free energy (F) of Mg x Cd 1−x Se ternary alloys.