First-principles study based on density functional theory (DFT) framework for structural, electronic and optical properties of titanium dioxide (TiO2) in anatase and rutile phases are investigated. Anatase phase exhibits wide band gap compare to rutile phase. The partial and total density of states for TiO2 (anatase and rutile) describes the occupying of titanium (Ti) and oxygen (O) atoms at each energy level. TiO2 has a high dielectric constant to avoid the recombination process while its high refractive index provides the efficient of light diffusion. The optical absorption of TiO2 occurs in ultraviolet (UV) light of the wavelength photon. The results from the first-principles calculations will be helpful to give an understanding about the properties of TiO2 as promising photoanode in dye-sensitized solar cell (DSSC).