Novel D–π–A type indole-based compounds have been designed and synthesized as active photosensitizers for dye-sensitized solar cells (DSSCs). The molecular structures of indole-based compounds were identified and characterized using IR, NMR, and HRMS spectra data. The attributes of the indole-based compounds were evaluated in terms of their optical, electrochemical, light-harvesting efficiency (LHE), HOMO/LUMO level and redox behaviour. Density functional theory (DFT) and time-dependent density functional theory (TD-DFT) were conducted to disclose the electronic and optical attributes of novel indole-based compounds. All the compounds revealed well-defined absorption with elevated absorptivity and a small band gap (2.89–3.01 eV). The HOMO to LUMO energy transfer percentage obtained from TD-DFT, for the synthesized compounds is in the range of 86%–99%. The projected light-harvesting efficiency (LHE) for the indole-based compounds is between 0.371 and 0.666. The greatest open circuit voltage (Voc) value was found in the methoxyphenyl-substituted indole-based compound, which is advantageous for DSSCs to obtain external maximum power output.