The structural, mechanical, thermal, and electronic structure properties of lead-free vacancy-ordered perovskites A2SnCl6 (A = Cs, Rb) were investigated by first-principles calculations under pressure in the DFT framework. DFT is used to study the effect of pressure (0–40 GPa) on these properties of A2SnCl6 (A = Cs, Rb) perovskites. The mechanical parameters show that these two perovskites in nature are mechanically stable, anisotropic, and ductile. It is shown that, as pressure increases, the electronic band gap of Cs2SnCl6 and Rb2SnCl6 increases from 3.495 eV to 4.958 eV and 3.446 eV to 4.722 eV, respectively. Electronic structure calculations show that Sn s orbitals and halogen Cl p orbitals mainly form the conduction band through combination, while the valence band consists only of halogen Cl p orbitals. The mechanical and electronic properties analysis proposes that these two perovskites are potential candidates for optoelectronic applications that work under changing pressure and altitude.