They both spend their lives in swamps & rivers in warm climates, although they breathe air through nostrils on the top of their snouts. Caymans & gavials are their relatives. The simple way of telling them apart is that crocodiles show the fourth tooth in
Their lower jaw when their mouths are closed. Alligators, on the other hand, do not. It is probably wise not to go near enough to a live crocodile to find out, however, as they have been known to attack humans.