Perovskite materials have gained considerable attention in recent years for their potential to improve the efficiency of solar cells. This study focuses on optimizing the efficiency of perovskite solar cells (PSCs) by investigating the thickness of the methylammonium-free absorber layer in the device structure. In the study we used a SCAPS-1D simulator to analyze the performance of MASnI3and CsPbI3-based PSCs under AM1.5 illumination. The simulation involved using Spiro-OMeTAD as a hole transport layer (HTL) and ZnO as the electron transport layer (ETL) in the PSC structure. The results indicate that optimizing the thickness of the absorber layer can significantly increase the efficiency of PSCs. The precise bandgap values of the materials were set to 1.3 eV and 1.7 eV. In the study we also investigated the maximum thicknesses of the HTL, MASnI3, CsPbI3, and the ETL for the device structures, which were determined to be 100 nm, 600 nm, 800 nm, and 100 nm, respectively. The improvement techniques used in this study resulted in a high power-conversion efficiency (PCE) of 22.86% due to a higher value of VOCfor the CsPbI3-based PSC structure. The findings of this study demonstrate the potential of perovskite materials as absorber layers in solar cells. It also provides insights into improving the efficiency of PSCs, which is crucial for advancing the development of cost-effective and efficient solar energy systems. Overall, this study provides valuable information for the future development of more efficient solar cell technologies.