In this study, we concentrated on optimal extraction, phytochemical, and electrochemical assessment of natural pigments from the roots and flowers of Persicaria lapathifolia as new sensitizers in dye-sensitized solar cells. The extraction technique required optimizing the use of acidified ethanol with acetic acid and hydrochloric acid as flower and root extractants, respectively. Photo-electrochemical tests revealed that these pigments could improve the efficiency of DSSCS. The optical characterization revealed maximal absorbance peaks at 462 and 654 nm for root dye and 535, 606 and 666 nm for blossom dye. Phytochemical examination revealed the presence of anthocyanins flavonoids glycoside linkage and betacyanin in both extracts. The Cyclic voltammetry tests revealed oxidation potential peaks in root and floral dyes the HOMO and LUMO potentials were calculated for both dyes, revealing values that could help improve DSSC performance. The DSSCS sensitized with flower extract had an open circuit voltage of 0.649 V a brief current pulse of 3.8 mA and an efficiency of 1.6335%. On the other hand root, pigment-based DSSCS performed slightly inferior with a Voc of 0.55 V an Isc of 3.7 mA, and an efficiency of 1.33%. These findings point to the potential of Persicaria lapathifolia pigments to boost DSSC efficiency emphasizing the relevance of sustainable energy sources. More research and optimization are required to realize the potential of these natural pigments for DSSC applications. This study adds to the investigation of green energy options, notably rooftop photovoltaic systems, in response to an increasing desire for ecologically sound energy solutions.