Non-bird dinosaurs lived on Earth from about 245 million years ago until their extinction around 66 million years ago, spanning the Mesozoic Era. This era is divided into three periods: the Triassic (starting around 245 million years ago), Jurassic, and Cretaceous (ending 66 million years ago)
. Dinosaurs first appeared during the Triassic Period, roughly between 243 and 233 million years ago, shortly after the Permian mass extinction about 252 million years ago
. They thrived and diversified through the Jurassic and Cretaceous periods until a mass extinction event wiped them out approximately 66 million years ago
. In summary, dinosaurs were alive from roughly 245 million years ago until 66 million years ago, meaning they existed for about 180 million years before going extinct