Abstract The structural, optoelectronic, magnetic, and mechanical investigations of Cs2KXBr6 (X = Mo & W); halide double perovskites (HDPs), in the Fm-3m space group, have been conducted via an ab initio study. The formation energies per atom (eV) of Cs2KMoBr6 and Cs2KWBr6 are found to be − 1.72 and − 1.81, respectively. To reveal the accurate energy band gaps of the materials, the TB-mBJ potential is utilized.