Perovskite solar cells (PSCs) have rapidly advanced, gaining attention for their high efficiency and affordability. In this paper, we have used machine learning (ML) models to analyse extensive data on perovskite compositions and bandgaps, aiming to identify optimal material combinations to enhance PSC performance. We have developed a ML-based approach focused on bandgap tuning, which has been a crucial factor for maximizing the photo conversion efficiency of PSCs. Traditional methods have often involved time-consuming and resource-intensive trial-and-error methods. In contrast, our approach using ML models have streamlined this process, significantly reducing the resources and time required for bandgap optimization, making PSC production more efficient and cost-effective. We have implemented three ML models Linear Regression, Random Forest, and Neural Networks, to predict bandgap values from a comprehensive dataset of perovskite compositions. Our results have indicated that Linear Regression has outperformed the others, achieving a root mean square error (RMSE) of 0.00314 and a Pearson Correlation Coefficient of 0.99997, demonstrating precise and reliable predictions. By utilizing machine learning-based prediction, this work has not only reduced reliance on traditional methods but also accelerated the development of high-performance PSCs, contributing to the ongoing evolution of sustainable and economically viable solar energy solutions.