Lead-free perovskites of Cs3Sb2X9 (X = Cl, Br, or I) have attracted wide attention owing to their low toxicity. High pressure is an effective and reversible method to tune bandgap without changing the chemical composition. Here, the structural and photoelectric properties of Cs3Sb2X9 under high pressure were theoretically studied by using the density functional theory. The results showed that the ideal bandgap for Cs3Sb2X9 can be achieved by applying high pressure. Moreover, it was found that the change of the bandgap is caused by the shrinkage of the Sb-X long bond in the [Sb2X9]3− polyhedra. Partial density of states indicated that Sb-5s and X-p orbitals contribute to the top of the valence band, while Sb-5p and X-p orbitals dominate the bottom of the conduction band. Moreover, the band structure and density of states showed significant metallicity at 38.75, 24.05 GPa for Cs3Sb2Br9 and Cs3Sb2I9, respectively. Moreover, the absorption spectra showed the absorption edge redshifted, and the absorption coefficient of the Cs3Sb2X9 increased under high pressure. According to our calculated results, the narrow bandgap and enhanced absorption ability under high pressure provide a new idea for the design of the photovoltaic and photoelectric devices.