TrID

TrID is a file format identification utility, similar in concept to the file command.

There are versions for Windows and Linux, plus an online version. It is free for noncommercial use.