Crocodiles are not dinosaurs, but the two groups are closely related. Both dinosaurs and crocodiles are considered archosaurs, a special group of reptiles that are distinguished from similar animals by having a single distinct skull opening in front of each eye.
Crocodiles do share some other features with their close relatives. Both crocodiles and dinosaurs have teeth set in jaw sockets. This protects the teeth from being yanked out during biting. Crocodiles and dinosaurs also both have specially shaped ankle joints and an extra ridge on the thigh bone that allows for stronger leg musculature.
Very ancient crocodile lineages resembled dinosaurs more closely than the animals we see today. They walked on two legs and lived on land. Crocodiles did not become specialized for life in water until about 200 million years ago. This is when they adopted their modern form of long, sleek four-legged animals with a sprawling, lizard-like gait.