We have examined whether the Co ions crystallographically substitute on the Ti sites in rutile and anatase Ti1−xCoxO 2−δ thin films that exhibit room-temperature ferromagnetism. Intensities of the x-ray Bragg reflection from the films were measured around the K-absorption-edge of Co. If the Co ions randomly substitute on the Ti sites, the intensity should exhibit an anomaly due to the anomalous dispersion of the atomic scattering factor of Co. However, none of the anatase and rutile samples did exhibit an anomaly, unambiguously showing that the Co ions in Ti1−xCoxO 2−δ are not exactly located at the Ti sites of TiO2. The absence of the anomaly is probably caused by a significant deformation of the local structure around Co due to the oxygen vacancy. We have applied the same method to paramagnetic Zn1−xCoxO thin films and obtained direct evidence that the Co ions are indeed substituted on the Zn sites.