Photovoltaic (PV) materials, especially organic and perovskite solar cells are effective candidates for meeting the rising global energy demand. Herein, we have designed indolo[3,2-b]indole-based six molecules (IDF1-IDF6) as hole-transporting materials (HTMs) for perovskite solar cells (PSCs) and donor materials for organic solar cells (OSCs). The results demonstrated that IDF1-IDF6 molecules have tight π-π stacking, more negative HOMO levels (-5.50 to -5.31 eV), low bandgaps (1.91 to 2.41 eV), high absorption coefficients, large Stokes shifts, high open-circuit photovoltages (1.31 to 1.50 V), and superior solubility with comparable stability compared with the reference (IDFR) and Spiro-OMeTAD molecules. The high light-harvesting efficiency and low exciton binding energy indicated that IDF1-IDF6 molecules have a higher photocurrent flow ability. The electronic excitation analyses of studied molecules showed that the IDF1-IDF6 molecules show stronger exciton dissociation, low charge coupling, and high intrinsic charge transfer with sharper charge flow than IDFR and Spiro-OMeTAD. Moreover, the high hole hopping rate, high total amount of charge transfer, and low reorganization energy with comparable charge transfer integral demonstrated that the designed molecules have effective hole transport ability for solar cells. Our remarkable results demonstrated that IDF1-IDF6 are advantageous molecules for the manufacturing of efficient PSCs and OSCs, and may have future commercial applications in the solar industry.