Six novel donor–π–acceptor organic dyes bearing a pyrimidine as the anchoring group have been obtained in good yields by combination of the microwave-assisted Suzuki cross-coupling and nucleophilic aromatic substitution of hydrogen reactions. Their absorption, photoluminescence and electrochemical properties were fully investigated in detail. The infrared spectra of dyes adsorbed on TiO2 indicate the formation of coordinate bonds between the pyrimidine ring of dyes and the Lewis acid sites (exposed Tin+ cations) of the TiO2 surface. This work demonstrates that the pyrimidine rings of dye sensitizers that form a coordinate bond with the Lewis acid site of a TiO2 surface are promising candidates as the electron-withdrawing anchoring group. The data from quantum calculations show that all of the dyes are potentially good photosensitizers for dye-sensitized solar cells.