We present an X-ray absorption spectroscopy study of the local structures of Gd(DTPA)2- and Gd(DOTA)- complexes in the crystalline state (at room and low temperatures) and in aqueous solutions exhibiting various pH values (0.15-7) at different temperatures (25-90 °C). Using X-ray absorption fine structure (XAFS) analysis procedures and ab initio multiple scattering calculations of XAFS spectra at the Gd L3 edge, we reconstructed the Gd3+ local environment, and compared it with existing structural models. From neutral pH to a value of 1.5, we found that the local environment and complex dynamics around the gadolinium ions were conserved up to 4.5 Å, and the structure agreed well with the known crystallographic data. In these solutions, the gadolinium ions in the complex Gd(DOTA)- are bonded to the four carboxylate oxygen atoms [R(Gd-Oav) 2.38 Å, Debye-Waller (DW) factor 0.006 Å2], to the four nitrogen atoms [R(Gd-Nav) 2.65 Å, DW factor 0.006 Å2] and to one water molecule [R(Gd-Ow) 2.46 Å, DW factor 0.012 Å2]. Concerning the complex Gd(DTPA)2-, the gadolinium ions are bonded to the five carbonyl oxygen atoms [R(Gd-Oav) 2.39 Å, DW factor 0.007 Å2], to the three nitrogen atoms [R(Gd-Nav) 2.64 Å, DW factor 0.006 Å2], and to one water molecule [R(Gd-OW) 2.47 Å, DW factor 0.018 Å2]. In the range of pH (0.15-1.5) for the Gd(DTPA)2- complexes, thanks to the pH strong dependence of the XAFS signals, we observed a progressive complex dissociation. On the other hand, the XAFS signals of Gd(DOTA)- complexes exhibited only a slight pH (1-1.5) dependence. Concerning both complexes, we noted just a slight temperature dependence.