Perovskites are the key enabler materials for the solar cell applications in the achievement of high performance and low production costs. In this article, the structural, mechanical, electronic, and optical properties of rubidium-based cubic nature perovskite LiHfO3 and LiZnO3 are investigated. These properties are investigated using density-functional theory with the aid of CASTEP software by introducing ultrasoft pseudo-potential plane-wave (USPPPW) and GG-approximation-PB-Ernzerhof exchange–correlation functionals. It is investigated that the proposed compounds exhibit stable cubic phase and meet the criteria of mechanical stability by the estimated elastic properties. Also, according to Pugh's criterion, it is noted that LiHfO3 is ductile and LiZnO3 is brittle. Furthermore, the electronic band structure investigation of LiHfO3 and LiZnO3 shows that they have indirect bandgap (BG). Moreover, the BG analysis of the proposed materials shows that these are easily accessible. Also, the results for partial density of states (DOS) and total DOS confirm the degree of a localized electron in the distinct band. In addition, the optical transitions in the compounds are examined by fitting the damping ratio for the notional dielectric functions scaling to the appropriate peaks. At absolute zero temperature, the materials are observed as semiconductors. Therefore, it is evident from the analysis that the proposed compounds are excellent candidates for solar cells and protective rays applications.