This article investigates the physical properties of lead-free tin- and germanium-based halide perovskites under pressure via the density functional theory to use as potential photovoltaic materials. Specifically, the structural, electronic, optical, and mechanical properties of KMCl3 (M = Ge, Sn) under diverse hydrostatic pressures ranging from 0 to 8GPa are examined to vindicate the compounds' superiority for useful applications. The structures show high precision in terms of lattice constants, which approves the formerly published data. The calculated lattice constant (5.261 and 5.58 Å for KGeCl3 and KGeCl3, respectively, at 0 GPa) and unit cell volume (145.67 and 173.80 Å3 for KGeCl3 and KGeCl3, respectively, at 0 GPa) are significantly reduced ((lattice constant 4.924 Å (5.183 Å) and unit cell volume 119.41 Å3 (139.39 Å3) for KGeCl3 (KSnCl3) at 8 GPa) due to the pressure effect, while the cubic phase stability is maintained. Under ambient pressure, the calculated band gap reveals the compounds' semiconducting nature. Nevertheless, when pressure is increased, the band gap narrows, enhancing its conductivity and igniting its route towards semiconductor to metallic transition. The ionic and covalent bonding nature of K-Cl and Ge(Sn)-Cl, respectively; as well as the decrement of bond length due to external pressure are marked by charge density mapping. The optical functions are also enhanced when pressure is devoted, vindicating the chosen perovskites' suitability in various optoelectronic devices in the visible and ultraviolet ranges. Likewise, while maintaining mechanical stability, hydrostatic pressure significantly impacts mechanical properties. The ductility and anisotropic behavior of both perovskites are intensified under applied pressure.