In this paper, density functional theory (DFT) was performed to study the adsorption properties of ornidazole on anatase TiO
2
(101) and (001) crystal facets under vacuum, neutral and acid-base conditions. We calculated the adsorption structure of ornidaozle on the anatase TiO
2
surface, optimal adsorption sites, adsorption energy, density of states, electronic density and Milliken atomic charge under different conditions. The results show that when the N(3) atom on the imidazole ring is adsorbed on the Ti(5) atom, the largest adsorption energy and the most stable adsorption configuration could be achieved. According to the analysis of the adsorption configuration, we found that the stability of C(2)-N(3) bond showed a weakening trend. The adsorption wavelengths of the electronic transition between the valence band and conduction band of ornidazole on the TiO
2
surface were in the visible light wavelengths range, showing that the TiO
2
crystal plane can effectively make use of visible light under different conditions. We speculate the possibility of ornidazole degradation on the surface of TiO
2
and found that the reactive site is the C-N bond on the imidazole ring. These discoveries explain the photocatalytic degradation of ornidazole by TiO
2
and reveal the microscopic nature of catalytic degradation.