Anchoring groups are crucial for enhancing the performance of dye-sensitized solar cells (DSSCs). For instance, cyanoacrylic acid serves as the primary anchoring group in DSSC due to its crucial elements required for effective electron transport. However, it suffers from degradation. To address this limitation, this study proposes alternative cyano-based anchoring groups for sensitizers. Density functional theory (DFT) and time-dependent DFT were used to investigate the optical and electronic properties of the dyes. The studied dyes (excluding the dye containing OH group) displayed three absorption bands within the visible and NIR regions. Low-energy peaks ranged from 498 to 576 nm, corresponding to excitation from ground state to first excited state. Moderate intensity bands appeared at 376 to 418 nm, with the highest energy bands falling within 351 to 384 nm. Ground state oxidation potential values for the dyes were lower than the redox potential of the iodide/triiodide pair. Similarly, excited state oxidation potential values were higher than or equal to the conduction band of TiO2, except for NO2 and CHO containing dyes. Ionization potential values ranged from 6.24 eV to 6.40 eV, while electron affinity values were within 1.21 eV to 2.74 eV. Chemical potential values ranged from 3.75 to 4.57 eV, and chemical hardness of the dyes fell between 1.83 to 2.54 eV. The proposed cyano-based anchoring groups show promising potential for enhancing DSSC performance.