Five novel organic push–pull dyes, DT, CD-T, TD-T, CD-C and TD-P, based on carbazole or triphenylamine as donors, dithieno[3,2-b:2′,3′-d]pyrrole as a π-spacer and cyanoacetic acid as an acceptor were synthesized, and their structures were optimized for DSSCs.