This study was focused on the photocatalytic activity of polyaniline (Pani)/iron doped titanium dioxide (Fe–TiO2) composites for the degradation of methylene blue as a model dye. TiO2 nanoparticles were doped with iron ions (Fe) using the wet impregnation method and the doped nanoparticles were further combined with Pani via an in situ polymerization method. For comparison purposes, Pani composites were also synthesized in the presence undoped TiO2. The photocatalyst and the composites were characterized by standard analytical techniques such as FTIR, XRD, SEM, EDX and UV–Vis spectroscopies. Fe–TiO2 and its composites exhibited enhanced photocatalytic activity under ultraviolet light irradiation. Improved photocatalytic activity of Fe–TiO2 was attributed to the dopant Fe ions hindering the recombination of the photoinduced charge carriers. Pani/Fe–TiO2 composite with 30 wt.% of TiO2 nanoparticles achieved 28% dye removal and the discoloration rate of methylene blue for the sample was 0.0025 min−1. FTIR, XRD, SEM, EDX and UV–Vis spectroscopies supported the idea that Fe ions integrated into TiO2 crystal structure and Pani composites were successfully synthesized in the presence of the photocatalyst nanoparticles. The novelty of this study was to investigate the photocatalytic activity of Pani composites, containing iron doped TiO2 and to compare their results with that of Pani/TiO2.