The ferromagnetic (FM) ordering in rutile TiO2 has been theoretically studied by substituting different p-block elements (B, Al, C, Si, N, P and As) doped at oxygen site (BO, AlO, CO, SiO, NO, PO and AsO) as well as at titanium site. Ab initio calculations in the frame work of density functional theory indicates that the p-block elements (B, C, Al, Si, N, P and As) when substituting the oxygen site give significant amount of magnetic moment, but induce zero magnetic moment in case of substitution at Ti site. Spin–spin interaction for (Ti12O23X)2 with X = B, Al, C, Si, N, P and As system has also been studied with two different doping distances. Among all the possibilities, carbon substitution at oxygen site (CO) results the most stable FM ordering in rutile TiO2.