Finding out what a file is

As an alternative to inspecting the file header by hand, you could use some utility like TrID. The link points to the cross-platform command line version; for Windows there's a GUI, too.


You don't say which operating system you're using.

If you were using a Unix-like OS, you could try

$ file filename*
filename.exe: MS-DOS executable PE  for MS Windows (console) Intel 80386 32-bit
filename.png: PNG image data, 2160 x 934, 8-bit/color RGB, non-interlaced
filename.rar: RAR archive data, v14, flags: Archive volume, os: Win32

where filename* is the name of the file(s) you want to check. Note that this program works by examining the file data, not the filename extension, so it would give the same output for filename.rar if you renamed it filename.zip.