The electronic, thermoelectric and optical properties of cubic CsMgX3 (X = Cl, Br) are performed using full potential augmented plane wave (FP-LAPW) method with the generalized gradient approximation (GGA) and modified Becke-Johnson (mBJ-GGA) approximation as exchange correlation potentials. The band profile of CsMgCl3 and CsMgBr3 using mBJ-GGA potentials exhibits indirect wide energy band gap of 6.35 and 4.26 eV, respectively. Further, thermoelectric properties are carried out as a function of temperature (100–1200 K) and chemical potential using BoltzTrap code. It has been found that thermoelectric efficiency increases with increasing temperature upto 1200 K. The figure of merit (ZT) values are calculated to 0.69 and 0.75 at room temperature for CsMgCl3 and CsMgBr3, respectively. Furthermore, optical properties are computed in the energy spectrum (0–12 eV). These materials absorb light in ultra violet region and can be used as absorber of UV-rays. Also materials are suitable for thermoelectric power generator applications.