Most faunas from the Mesozoic era were dominated by sauropod dinosaurs, the largest terrestrial animals to ever exist. These megaherbivores were remarkably diverse and widely distributed. Here we study three Late Jurassic faunas from the USA, Portugal and Tanzania, each approximately 150 million years old, which are known for their extreme sauropod diversity. Whereas general taxonomic composition was similar in these three faunas, the major clades differed in relative abundance. Moreover, their depositional strata record distinct climatic regimes. Using dental microwear texture analysis, we investigated the impact of these climate regimes and the resulting food availability on the different sauropod taxa. Wear patterns in camarasaurid macronarians show minimal variation across different climate regimes, supporting previous studies suggesting that these animals migrated to follow their preferred climate niche and food source. North American camarasaurids show similar wear patterns to those of Portuguese turiasaurs, another broad-crowned taxon, which did not exist in the Jurassic of North America. By contrast, where camarasaurids and turiasaurs co-occurred in Portugal, their microwear patterns are distinct, suggesting niche differentiation to avoid ecological competition between these two clades. Flagellicaudatan diplodocoids display highly variable wear patterns, indicating limited migration (and therefore seasonal variation in diet), which aligns with observed biogeography patterns in the USA. Early-branching titanosauriforms show highly distinct wear patterns between different climate regimes, which can probably be attributed to different abrasive loads in the respective habitats. Our results demonstrate that dental microwear texture analysis not only records dietary preferences but also reveals behaviour such as competition and migration related to dietary niches in past ecosystems.