A series of In and B co-doped TiO2 samples are prepared by sol-gel method under different pH values. The detailed existing states of introduced In and B ions are investigated via XRD, FT-IR, XPS and HRTEM. It is found that the B ions are mainly doped into TiO2 in interstitial mode and In ions exist as surface O-In-Clx species when the pH values are in the range of 0.31∼0.65. With the increase of the pH values (0.82∼3.40), the introduced In and B ions would react with each other to form InBO3. The existing states of In and B ions in TiO2 can be easily changed by adjusting the pH values to achieve a new type of TiO2 based materials with controlled structures.