The short answer
A crocodile is not a dinosaur because it sits on a different branch of the reptile family tree. Crocodiles and dinosaurs are both archosaurs, a group sometimes called the “ruling reptiles,” and they share a common ancestor. But their lineages split apart early in the Triassic Period, roughly 250 million years ago, well before the first dinosaurs appeared.
One branch led to crocodiles and their relatives. The other led to pterosaurs, dinosaurs and, eventually, birds. So crocodiles are close cousins of dinosaurs, not members of the group.
How scientists define a dinosaur
Today, most paleontologists define dinosaurs by ancestry rather than by a checklist of looks. A common definition is: the most recent common ancestor of birds and Triceratops, plus all of its descendants. Anything descended from that ancestor is a dinosaur. Anything outside it is not.
Under that kind of definition, crocodiles fall outside. Their family line branched off before that ancestor existed. That’s also why birds are counted as living dinosaurs, a topic covered in more depth if you’re asking are birds descendents of dinosaurs.
This approach also explains why other famous ancient reptiles, like pterosaurs, plesiosaurs and mosasaurs, aren’t dinosaurs either. If you’re interested in that broader picture, it helps to look at what’s the difference between dinosaurs and ancient reptiles as a whole.
The archosaur family tree
Archosaurs split into two main lines early in their history.
The crocodile line
One branch is often called the crocodile line, or Pseudosuchia. Crocodiles, alligators, caimans and gharials are its only surviving members. In the Triassic, though, this branch was very diverse. It included large predators, armored plant eaters and some animals that walked on two legs. Many of these groups died out at the end of the Triassic, but the crocodylomorphs, the group that includes modern crocodilians, survived.
The bird line
The other branch, sometimes called the bird line or Avemetatarsalia, includes pterosaurs, dinosaurs and a few small early relatives. Birds are the only members of this branch alive today.
So when people ask who are the relatives of dinosaurs, crocodiles are one of the best answers. They are among the closest living relatives of the dinosaur group, just not dinosaurs themselves.
Anatomy that separates them
Because dinosaurs are defined by ancestry, anatomy is the evidence scientists use to work out where a fossil belongs. Several features of the skeleton help tell dinosaurs apart from crocodiles and other archosaurs.
Posture and legs
Dinosaurs held their legs directly beneath their bodies, like pillars. This fully upright posture is one of the classic dinosaur traits. Modern crocodiles, by contrast, usually move with their legs angled out to the sides in a semi-sprawling posture, although they can lift their bodies higher in what’s often called a “high walk.”
Hip socket
In most dinosaurs, the hip socket has an opening right through the middle, so it looks like a hole rather than a cup. This “open” or perforated hip socket is linked to their upright stance. Crocodiles have a more closed socket. Within dinosaurs there are further differences in hip structure, which is the basis of the split into lizard hipped and bird hipped dinosaurs.
Ankle joint
The ankle is one of the main features used to tell the two archosaur branches apart. In the crocodile line, the ankle has a kind of ball-and-socket arrangement that lets the foot rotate. In the bird line, including dinosaurs, the main ankle joint works more like a simple hinge between rows of ankle bones. It’s a technical detail, but it’s been important in sorting out early archosaur fossils.
Other differences show up in the skull, the shoulder and the hand, but posture, hips and ankles are the features people most often point to.
Crocodiles’ ancestors were not always crocodile-shaped
It’s tempting to think crocodiles are “living fossils” that haven’t changed since the dinosaur era. That’s only partly true. The modern body plan, a low, armored, semi-aquatic ambush predator, has worked well for a very long time. But many early crocodile relatives looked quite different.
Some of the earliest crocodylomorphs from the Late Triassic were small, slender animals with long legs that lived on land and appear to have been capable of fairly upright posture. Later relatives included fully marine forms with flipper-like limbs and tail fins, and some land-dwelling species with surprisingly mammal-like teeth. So crocodiles have their own long and varied history. Crocodile relatives and dinosaurs did share the world for well over 150 million years, which is why did crocodiles exist with dinosaurs is a common question with a firm yes as the answer.
So who is a crocodile’s closest living relative?
Here’s the part that surprises many people: a crocodile’s closest living relatives are birds. Among animals alive today, crocodilians and birds are the only surviving archosaurs. That makes a crocodile more closely related to a sparrow or a chicken than to a lizard, snake or turtle.
It also means that in terms of family relationships, a crocodile and a Tyrannosaurus are roughly as related as a crocodile and a pigeon, since both T. rex and pigeons belong to the dinosaur branch.
Why “old and scaly” doesn’t make something a dinosaur
Crocodiles feel like dinosaurs. They’re large, scaly, prehistoric-looking reptiles with a long fossil record. But dinosaurs aren’t defined by how ancient or reptilian an animal seems. They’re defined by where they sit on the family tree.
Crocodiles branched off from the line leading to dinosaurs before dinosaurs existed. They evolved alongside dinosaurs, survived the extinction event that ended the age of non-bird dinosaurs, and are still here today. They are close cousins with their own long story, not dinosaurs that survived.