Ab initio density functional theory calculations of the relative stability of the anatase and rutile polymorphs of TiO2 were carried out using all-electron atomic orbitals methods with local density approximation. The rutile phase exhibited a moderate margin of stability of ~ 3 meV relative to the anatase phase in pristine material. From computational analysis of the formation energies of Si, Al, Fe and F dopants of various charge states across different Fermi level energies in anatase and in rutile, it was found that the cationic dopants are most stable in Ti substitutional lattice positions while formation energy is minimised for F− doping in interstitial positions. All dopants were found to considerably stabilise anatase relative to the rutile phase, suggesting the anatase to rutile phase transformation is inhibited in such systems with the dopants ranked F > Si > Fe > Al in order of anatase stabilisation strength. Al and Fe dopants were found to act as shallow acceptors with charge compensation achieved through the formation of mobile carriers rather than the formation of anion vacancies.