Here, a modeling guided device optimization process using Solar Cell Capacitance Simulator-One Dimensional (SCAPS-1D) was employed to study the performance of Pb-based and Sn-based perovskites in perovskite solar cell (PSC) structures. The methylammonium (MA)-based and stable Cs-based perovskites, which are respectively hybrid organic-inorganic perovskites (HOIPs) and all-inorganic perovskites (AIPs), were selected for comparative study. The effect of the various AIPs (CsPbCl3, CsPbBr3, CsPbI3, CsSnCl3, CsSnBr3, and CsSnI3) and HOIPs (MAPbCl(3), MAPbBr(3), MAPbI(3), MASnCl(3), MASnBr(3), and MASnI(3)) on the performance of the p-n planar device structure FTO/SnO2/Perovskite/Cu2O/Carbon PSCs was investigated. The perovskites CsSnCl3, CsSnI3, MASnBr(3), and MASnI(3) exhibited higher efficiency compared to their Pb-based counterparts. Most Cs-based perovskites, with the exception of CsPbI3, have exhibited superior performance compared to their MA counterparts. The device consisting of CsSnI3 AIP shows the highest power conversion efficiency (PCE) of 18.45% and the highest short circuit current density (JSC) of 32.85 mA/cm(2). It exhibits the highest thermal stability between 300 and 500 K. This demonstrates the possibility of achieving Pb-free AIP solar cells with high performance and thermal stability that could compete with Pb-based perovskites. Then, the thickness of different layers (Cu2O, CsSnI3, and SnO2), the doping, total defect density, electron and hole capture cross-sections, bandgap, electron affinity, dielectric permittivity of CsSnI3, temperature, series and shunt resistances, and interface total defect densities at the Cu2O/CsSnI3 and CsSnI3/SnO2 interfaces have systematically been investigated and optimized. The PCE achieves its highest value of 21.52% with the optimum values.