In improving PV system performance, the parameters associated with electrical photovoltaic equivalent models play a pivotal role. However, due to the increased mathematical complexities and non-linear traits of PV cells, the precise prediction of these parameters is a challenging task. To estimate the parameters associated with PV models, a reliable, robust, and accurate optimization technique is needed. This paper introduces a new algorithm, Rat Swarm Optimizer (RSO), for obtaining the optimum PV cell and module parameters. The proposed method maintains an adequate balance between the exploration and exploitation phases to overcome premature particle issues. The results obtained using RSO are compared with those of other algorithms, i.e., Particle Swarm Optimization (PSO), Ant Lion Optimizer (ALO), Salp Swarm Algorithm (SSA), Harris Hawks Optimization (HHO), and Grasshopper Optimization (GOA), in this work. The modified one-diode model (MODM) and modified two-diode model (MTDM) are used to analyze the parameters of the mono-crystalline PV cell using the suggested RSO. The obtained findings imply that the parameters estimated by the suggested RSO are more accurate than those calculated by the other algorithms taken into consideration in the paper. The statistical results are compared, and it is clear that RSO is a very accurate, fast, and dependable approach for the parameter estimation of PV cells.