Titanium dioxide (TiO2) is commonly used in high-performance carbon-based mesoscopic perovskite solar cells (C-MPSCs), but its relatively low charge mobility and severe carrier accumulation hinder further improvements in device performance. Here, we demonstrate the use of aluminum and indium co-doped TiO2 (AlIn-TiO2) as compact layers for highly efficient C-MPSCs. AlIn co-doping not only optimizes the band alignment at the AlIn-TiO2/perovskite interface, but also facilitates the charge transfer of pristine TiO2. As a result, the performance of AlIn-TiO2-based C-MPSCs is overall improved with an efficiency of 15.53%, which is more than 15% higher than that of pristine TiO2-based device (13.49%). This work enriches the metal doping mechanism of TiO2 and provides a simple and feasible method for obtaining efficient printable C-MPSCs.