The geometrical structures and electronic properties of Ni-doped anatase and rutile TiO2 were successfully calculated and simulated by a plane wave pseudopotential method based on density functional theory (DFT). Our results show that most Ni 3d states are located in the forbidden band of substitutional Ni to O-doped anatase and rutile TiO2, and mix with O 2p states, resulting in a decrease of the photon excitation energy and red-shift of absorption edge compared to pure anatase and rutile. For substitutional Ni to Ti-doped anatase TiO2 under O-rich growth condition, the band gap has a slight decline of about 0.05eV compared with pure anatase TiO2 and contains a series of impurity energy levels, which may be responsible for the experimental photocatalytic activity and red-shift of absorption edge.